Jump to content

Archived

This topic is now archived and is closed to further replies.

bobleny

I have a line of php that isnt correct

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

Share this post


Link to post
Share on other sites
What are you trying to do?

This segment: [code]<?php strpos($_POST['email'] != " ") ?>[/code] is missing some parameters.

Ken

Share this post


Link to post
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...

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Yeah, I, I.. I don't get the whole needle in the hey stack thing... naope

Share this post


Link to post
Share on other sites

×

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.