Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
text form data to mysql depending on input and user ?
Maq replied to crazzypappy's topic in PHP Coding Help
The array, unless you have a special case for each word but it seems like you just want to check to see if the input is in the list, and if it is, use it in the search. If that's the case, the array is better. -
Where are you getting these object names from?
-
text form data to mysql depending on input and user ?
Maq replied to crazzypappy's topic in PHP Coding Help
if(isset($_POST['submit'])) { $input = $_POST['input']; $whitelist = array("word1", "word2", "word3"); if (in_array($input, $whitelist)) { $sql = "UPDATE phpbb_user SET gword2='$input' WHERE user='MM_Username'"; echo "UPDATE Successful Query: $sql"; } else { echo "$input is invalid..."; } } ?> </pre> <form action="<?php%20echo%20%24_SERVER%5B'PHP_SELF'%5D;%20?>" method="POST"> < Notes: - Use mysql_real_escape_string to santize the string (prevent SQL Injections). - You may want to keep everything lowercase so there's no case sensitivity issues. Just keep everything lower case in the array and use strtolower() on the input. -
Yeah most of the things you want to do "live" has to be done with some sort of client side language, usually javascript. Just remember that PHP gets parsed and rendered into HTML before the user even does anything. You're welcome
-
Even though it's from 2000, it seems to be exactly what you're looking for. It's JS, which is the only way you can really do live character counts: JS Char count
-
Something like: $loop = 10; for($i=65;$i{ $i = ($i==91) ? 65 : $i; echo "=SUM(".chr($i)."5:".$letter.$restot.")"; } ?>
-
Or this... for($i=65;$i echo chr($i);
-
Opera? Who uses Opera still?! (Kidding of course - a good browser, just really never makes it into the headlines like Firefox or IE, or hell, even Chrome when it launched) That's because of the small amount of mac users, even so, most of them probably use FF.
-
Heh, that's cool, I didn't know that. Guess cause I don't use Opera
-
What's the exact error? And put this after you query in case it contains errors. This will kill the script and output a "descriptive" error message. mysql_query("UPDATE news SET header='$header', news='$news', date='$date' WHERE ID=$id") or die(mysql_error());
-
Like I said, put it in a loop to 100 and see what it outputs. I'm sure the OP didn't want â„¢ in his list of characters, actually.
-
Is there a specific reason you want to do this? I'm almost positive you can just give the w3 validator specific pages to check. KingPhilip's suggestion would be a lot more convenient, I'm gonna check it out myself
-
Why don't you use CSV. That way you can develop on your machine, and with a click away, send them to your desired server.
-
Why don't you create a MySQL class with all the methods you need. This would make things 100x easier and faster. There are plenty of examples on phpfreaks. For this take a look at autoload().
-
Lol, you're welcome. The errors should have told you what line it was on. Actually it probably pointed to the last line. Anyway, mark as [sOLVED] please, thx
-
Missing a ';' $date = $_POST['date'];
-
Yes chmod works on windows but I don't think that's the way to go because it could spawn security issues. I'm not sure how you have your system setup but you should hide these documents behind the root folder so no one can get to them. Have a page where users must be logged in (check session var) to get these files from. Make sense?
-
It all depends. It's not the cron itself, it's the scipt and other issues. It would depend on your server, how you have your DB setup, how many rows you're deleting, how optimized your code is etc...
-
Ok, how are you trying to tweak it?
-
text form data to mysql depending on input and user ?
Maq replied to crazzypappy's topic in PHP Coding Help
You should just create a white list array and check if the user typed in a valid word with in_array(). -
What exactly do you mean? And yes, there are scripts out there that do similar tasks.
-
Let's try and not double post.... http://www.phpfreaks.com/forums/index.php/topic,246258.msg1151169.html#msg1151169 Besides I responded to you in your other post.
-
You replace this: if ($dontsendemail == 0) {mail($emailaddress,"Subject: $subject",$message,"From: $email" ); echo "Email sent!!";} With this? Do it again I bet you forgot to add the extra } in for the final if statement. if ($dontsendemail == 0) { if(mail($emailaddress, $subject ,$message, "From: $email" )) { echo "Email sent!!";} } else { echo "Email NOT sent... vars: to=> " . $emailaddress. " subject=> " . $subject . " from=> " . $email; } } Also, put this at the top of your page directly after your first opening <?php tag: ini_set ("display_errors", "1"); error_reporting(E_ALL);
-
You should look into implementing AJAX. There are some good libraries & frameworks out there for it too.
-
Change the last line in mailform.php, try to sign up again and tell me what it says. if ($dontsendemail == 0) { if(mail($emailaddress, $subject ,$message, "From: $email" )) { echo "Email sent!!";} } else { echo "Email NOT sent... vars: to=> " . $emailaddress. " subject=> " . $subject . " from=> " . $email; }