Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
Create a boolean. $array=array('first','second','third','3423a','76676'); $foundOne = FALSE; foreach($array as $arrays){ $result=strpos($arrays,'76'); if($result!==false){ echo 'found it '; $foundOne = TRUE; break; } } if($foundOne == FALSE) echo "You didn't find anything"; echo ' Break allows for more processing here.';
-
You have to display the message not just assign a variable to it. $message="Enter Title"; echo $message;
-
You could use sessions.
-
Undefined variables! when used on a different server!
Maq replied to Logical1's topic in PHP Installation and Configuration
Thanks for the clarification Mchl! -
I like that...
-
Undefined variables! when used on a different server!
Maq replied to Logical1's topic in PHP Installation and Configuration
1) What's the difference between PHP4 and PHP 4? 2) Put this at the top of your code and tell me if there is a more specific error: ini_set ("display_errors", "1"); error_reporting(E_ALL); 3) Put quotes around your parameters </pre> <form method="POST" action="calculate.php"> < etc... 4) On calculate.php it should be: Hello <?php print $_POST['NAME1'] ?> -
searching/echoing any unknown single or multiple word search
Maq replied to paulmo's topic in MySQL Help
Try something like this: $message_string =$_POST['message']; $pre_filter=trim($message_string); $get_search=explode(" ",$pre_filter); foreach ($get_search as $final_string){ $sql = "SELECT * FROM beta WHERE terms LIKE '%{$final_string}%'"; $sql = substr_replace($sql,"",-2); //take off the last 'or' $posts =mysql_query($sql) or die(mysql_error()); $n=0; while($row=mysql_fetch_assoc($posts)){ $n++; echo $row['terms']; echo " "; } } -
Yeah, why not? Have you tried it and failed?
-
Yes it is as simple as that. Although I'm not sure if your time is correct.
-
You need to go to your crontab and edit it. At the CLI type (i think): crontab -i to edit your cron and add in the time parameters and the path to the script you want executed.
-
Why would you ever want to link to a function?
-
You may want to give the correct link first. It's http://www.rasclerhys.com/forum.php NOT (this would be a folder, which is probably what you should do)
-
searching/echoing any unknown single or multiple word search
Maq replied to paulmo's topic in MySQL Help
You're concatenating multiple WHERE clauses onto $sql in your foreach loop, and essentially giving mysql_query an invalid statement. Put this in as well: $posts =mysql_query($sql) or die(mysql_error()); -
If you're echoing HTML you shouldn't have to use <?php ?> tags that often... $break = "break"; echo "Hey this is a line $break"; ?>
-
Cron is relatively easy to use, just specify time and script you want to execute. The hardest part is the time-format.
-
Don't you want to loop through the results from the first query and use them for the second? Also, echo out your queries so you can see what's in them. $query_sections = "SELECT * FROM tblsubsections WHERE imgsrc LIKE '%{$value}%' "; echo $query_sections; $sections = mysql_query($query_sections, $promo) or die(mysql_error()); while($row_sections = mysql_fetch_assoc($sections)) { //update data into imgsrc $query_section = "UPDATE tblsubsections SET printareaimgsrc = '/images/printarea/{$value}.jpg' WHERE subsectionid = '{$row_sections['subsectionid']}'"; mysql_query($query_section, $promo) or die(mysql_error()); echo $query_section . " ";
-
Could you be a little more explanatory? Like what you're counting?
-
My post was based off your answer... I was stating why you used the brackets. With double quotes you don't need brackets with singles you do.
-
You need to use brackets because the php variables don't get evaluated in single quotes.
-
Have you read any tutorials? Google this and come back with specific questions. Unless you want design suggestions.
-
You make a link with the $_GET method and wherever you process it, you just call that variable in the SQL statement. You can use a cron job to run a script either every 12 hours or 1 day. Can you be a little more specific?
-
Then there would be a much larger trading market for illegal fire arms. Criminals can get guns regardless if they're banned. Just like they already illegal weapons, AK's, grenades, etc... Your suggestion/belief really won't help much.
-
[SOLVED] getting mysql to accept a value from a text field in a form
Maq replied to anfo's topic in PHP Coding Help
Does this mean that you have solved the issue? -
Yeah you can do it that way. I guess you could call it a prepared link. Header should automatically redirect the user. Glad you got it working.