Search found 11 matches

by clang
Mon Oct 27, 2008 2:03 pm
Forum: Databases
Topic: Error Code I can't fix
Replies: 0
Views: 262

Error Code I can't fix

I'm sorry for this post. I have no idea what is happening, so I'm not sure what information is needed to help you guys help me. In the past 2 weeks my site has gone down twice. Each time it reported the same code. Connect failed: Lost connection to MySQL server at 'reading authorization packet', sys...
by clang
Tue Oct 30, 2007 2:05 pm
Forum: Javascript
Topic: Adding additional fields
Replies: 1
Views: 647

Adding additional fields

Right now I have a form that takes in information. This form is set up to take 10 sets of the same information. If you fill in none, or some of the sets, it continues on. If you fill in all 10, it also continues on, but there is no option to enter in more than 10. What I would like to have happen is...
by clang
Thu Jul 26, 2007 1:55 pm
Forum: PHP - Code
Topic: Exracting characters from a string & Detecting blank fie
Replies: 14
Views: 1427

Good point.
I document my code fairly well though, so I should be ok.
Thank you for the tip though. It's always interesting to me to find the different ways of solving the same problem, and comparing them with each other.
by clang
Thu Jul 26, 2007 12:52 pm
Forum: PHP - Code
Topic: Exracting characters from a string & Detecting blank fie
Replies: 14
Views: 1427

Re: Exracting characters from a string & Detecting blank

putting it all together if(isset($_POST['foo']) && strlen(trim($_POST['foo'])) > 0) /// $_POST['foo'] is given and contains at least one non-space character It's hard for me to believe that is more efficient than $foo=ereg_replace( ' +', '', $foo); if(!empty($foo)) ... Even if using regular...
by clang
Wed Jul 25, 2007 2:38 pm
Forum: PHP - Code
Topic: Exracting characters from a string & Detecting blank fie
Replies: 14
Views: 1427

superdezign wrote: Don't use ereg_replace. This isn't a time for regular expressions. You'd be better of with str_replace().
Why so?
by clang
Wed Jul 25, 2007 2:27 pm
Forum: PHP - Code
Topic: Exracting characters from a string & Detecting blank fie
Replies: 14
Views: 1427

Re: Exracting characters from a string & Detecting blank

if(!empty(trim($_POST['foo'])) { .... } Thanks for the advice. Your solution actually gave me an error when I ran it. It didn't like trim being inside the empty() function. But no matter, as it pointed me in the right direction in the manual. For any one else that should ever need it here is the so...
by clang
Wed Jul 25, 2007 1:57 pm
Forum: PHP - Code
Topic: Exracting characters from a string & Detecting blank fie
Replies: 14
Views: 1427

miro_igov wrote:

Code: Select all

echo dirname('/data/fs1/HFtest20070724205643.pdf');
That's perfect. Thank you. And thanks also astions.
So that solves problem 1. Any suggestions about problem 2?
by clang
Tue Jul 24, 2007 9:29 pm
Forum: PHP - Code
Topic: Exracting characters from a string & Detecting blank fie
Replies: 14
Views: 1427

Exracting characters from a string & Detecting blank fie

I have two questions. I would appreciate any help I can get. 1) I need to be able to take the string "/data/fs1/HFtest20070724205643.pdf" and extract only "/data/fs1/". Then problem I'm having is the "../fs1/.." part isn't a constant. It needs to have the ability to be ...
by clang
Wed Jun 13, 2007 4:02 pm
Forum: Installation and Configuration
Topic: Problem with Session
Replies: 4
Views: 1392

I hate myself so much right now.
Thank you. It was temp, not tmp.
by clang
Tue Jun 12, 2007 7:57 pm
Forum: Installation and Configuration
Topic: Problem with Session
Replies: 4
Views: 1392

So how do I make it exist to PHP?
The folder exists to windows.
by clang
Tue Jun 12, 2007 2:33 pm
Forum: Installation and Configuration
Topic: Problem with Session
Replies: 4
Views: 1392

Problem with Session

I'm sorry if this has been answered before. I searched through a bunch of topics and haven't yet found a solution to my problem. Any help is appreciated. When running this code <?php session_start(); print session_id(); ?> I get this for a result page Warning: session_start() [function.session-start...