This is a discussion on "IF value entered is nothing?" within the PHP Forum section. This forum, and the thread "IF value entered is nothing? are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
IF value entered is nothing?
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
IF value entered is nothing?
I forgot how to do this and I can't find anything in google.
I need a quick if to search if $gamertag has anything entered, if it doesn't i need it display an error message otherwise display the below. Thanks.
|
|
|
|
|||
|
Re: IF value entered is nothing?
if (isset($gamertag))
or if ($gamertag) or if (trim($gamertag)) or if(trim($gamertag) != "") should all return true if $gamertag is set. (I think...) |
|
|||
|
Re: IF value entered is nothing?
Thanks.
|
|
|||
|
Re: IF value entered is nothing?
|
|
||||
|
Re: IF value entered is nothing?
What's with the echo's all over the place?!
|
|
|||
|
Re: IF value entered is nothing?
Yeah actually, I won't need them now
Can you spot my problem though? I'll clean the echos up before i update the site with the working if |
|
||||
|
Re: IF value entered is nothing?
There's an else { } too many ... at the bottom?! and a few things wrong.
Here's what I got when removing the echo's
What's this? }; } |
|
|||
|
Re: IF value entered is nothing?
That's ending;
|
|
||||
|
Re: IF value entered is nothing?
Ah ... like this then
|
|
|||
|
Re: IF value entered is nothing?
Looks much cleaner(Thanks) and I doubt you know but you also fixed another problem i had, it would randomly display a '1' after the image
Any idea as to why the isset is not working? |
|
|||
|
Re: IF value entered is nothing?
http://www.360sigs.com/gamercards.php
They get it from entering there tag, enter my tag 'PicoDeath and at the top it will display 'Thank you PicoDeath', enter no tag and it KNOWS nothing is in the form because it displays 'Thank you No username here for using...' |
|
||||
|
Re: IF value entered is nothing?
|
|
|||
|
Re: IF value entered is nothing?
Put that in just now, it displays 'Enter a gamertag' yet you entered one and it displays it at the top. And if you don't enter one it displays the code i want it too.
I guess i just switch the contents of the IF around for it to work? Fixed thanks. Last edited by PicoDeath; Aug 2nd, 2007 at 16:34. |
|
||||
|
Re: IF value entered is nothing?
Opps ... right...hehe ... yes
I guess it would something like this
|
|
|||
|
Re: IF value entered is nothing?
Haha, I asked because you were replying so fast in the end i just tried it and it worked.
|
![]() |
| Tags |
| form, none |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Repeat data entered in a text box... and maybe change it? | simbo1231 | JavaScript Forum | 4 | Dec 2nd, 2007 10:24 |
| Setting Form Values to Previously Entered Values | masonbarge | PHP Forum | 6 | Oct 17th, 2006 17:36 |
| Open different pages depending on value entered into input box | IanW | PHP Forum | 5 | Sep 15th, 2006 17:48 |
| Open a specific page dependent on what is entered into a criteria box??? | IanW | Web Page Design | 2 | Sep 15th, 2006 12:39 |