Jump to content

I have a line of php that isnt correct


bobleny

Recommended Posts

if (strpos($_POST['email'],"@") && strpos($_POST['email'],".") && strpos($_POST['email'] != " ") && $_POST['name'] != "" && $_POST['link1'] != "" || $_POST['link2'] != "" || $_POST['link3'] != "" || $_POST['link4'] != "" || $_POST['link5'] != "")

Yeah see that? somethings wrong with it! I think it has something to do with the perenthasies but i cant figure it out. I'm not to good with php. If any one can help please do!

Thanks
Link to comment
Share on other sites

Well i figuered it was that one because when you take it out it works. This is a if statement thats saying if all feileds check out the display send button. Evrey thing else works fine. I just tryed to add that so if the email feild has a space, it wont display the send button.

So? <?php strpos($_POST['email'] != " ") ?>
is missing some parameters.

what is it missing? it looks good to me...
Link to comment
Share on other sites

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]So? <?php strpos($_POST['email'] != " ") ?>
is missing some parameters.

what is it missing? it looks good to me...[/quote]

Did you look in the [a href=\"http://www.php.net/strpos\" target=\"_blank\"]manual[/a] to determine how to use the strpos() function?

Here is the desciptions:
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]int strpos ( string haystack, mixed needle [, int offset] )

Returns the numeric position of the first occurrence of needle in the haystack string.[/quote]
You will notice that it needs at least two parameters. You gave it one, plus you have the closing parenthesis in the wrong place. You coded all the other calls to the function correctly,

Ken
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.