-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
no, but it is different depending on browser. I bet he's using IE vs. you using FF or visa versa or something
-
yeah you should also go ahead and either manually or write a quick script to trim your db entries to get rid of the \n's so you don't have to have those trims in there. data in dbs should be as unformatted as possible.
-
Or maybe he generates dirty cars. Like dumps dirt and stuff all over it and then does his thing.
-
Was gonna say... in a text file to db a \n is on the end of the line. But trim should have taken care of that. Was gonna next suggest changing selected='selected' instead of SELECTED (something you should do anyways)
-
store the IP address in the account table (where the rest of the acct info is being stored), along with timestamp of registration. When user registers, check the IP address to see if it exists, and if so, compare timestamp with current time. This isn't really all that effective, though, as most spambots go through a proxy server to change up IP addresses. So far the most effective means of preventing spam is by using captcha verification or creating a honeypot to catch spambots.
-
Yeah I'm suspecting the same thing as lonewolf: Some errant spacing or newline or tab char or something. Do this: if(strcasecmp(trim($their_country),trim($current_country)) == 0){ That should hopefully do the trick. If so, I recommend you backtrack in your script to where they are being put in the db in and trim them going into the db instead, though.
-
hmmm.... do this: while($z = mysql_fetch_array($country)){ $current_country = $z[country]; echo $their_country . " : " . $current_country . "<br/>"; if(strcasecmp($their_country,$current_country) == 0){ //not theirs print "<option value=\"$current_country\" SELECTED>$current_country</option>"; } else { //their print "<option value=\"$current_country\">$current_country</option>"; } post what that echo echoes out.
-
how are those variables being assigned? Are they coming from a form, assigning them from $_POST array?
-
okay so once again you have a random extra comma in your code, so it is expecting another value.
-
with strcasecmp you want to see if it equals zero.
-
so where is $x[location] being set?
-
Remember back in the day when people actually wrote objective articles?
-
Did you google it?
-
isset($var) vs. !isset($var) works as intended. There's no "bug" in them that causes them to work in reverse. If you had to do the opposite to make something work, it's because something else in your script was messed up.
-
As far as the actual error, it's because you have a comma in there, which makes sprint expect another argument, which you are not providing. But seeing as how you aren't actually doing anything sprintf specific, you should remove it altogether, as WT posted.
-
you will need to implode with | as delimiter and wrap it in parenthesis
-
If you want to understand what is going on (and therefore what is going wrong), you need to make a more concerted effort on your part. I think you should probably step back and learn basic php syntax, because you seem to be struggling with basic syntax issues. Your mail function is still not sending to anybody else because you removed $headers, which is what you are using in your mail function. $bcc = $_POST['bcc']; $headers .='Bcc: ' . $bcc ."\r\n";
-
Sounds like you should look into a framework, like Zend or CakePHP
-
<?php $items = array('jeans','watches','everything'); $file = (in_array($_GET['item'],$items))? $_GET['item'] : $items[0]; // change $items[0] to whatever you want as default include ($file . ".php"); ?> <li><a href='?item=jeans'>jeans</a></li> <li><a href='?item=watches'>watches</a></li> <li><a href='?item=everything'>everything</a></li>
-
okay, so you've made other changes to your script, in addition to the ones suggested. You are now saving based on $_REQUEST['saving'] being 1. I do not see anywhere in your script that sets that to 1. As in, I do not see any elements in your form called 'saving'.
-
post your current script with changes. I c/p'd your script, changed those 2 things, and it worked just fine for me.
-
haha that's kind of neat. So does he just pick random dirty cars and does it while owner is not at home or something?
-
foreach ($array as $key => $val) { if (stripos($val,'.delicious.') !== false) { unset ($array[$key]); } }
-
The problem in the OP script (other than using deprecated stuff, but they still work), is a) your form action points to your text file. Change it to "" or name of the script (so it points to the script) b) you are using $_POST['description'] for your text area but you named your text area 'comments' so that value will not be written to your file unless you change that.
-
So what's the problem (other than not using code tags) ?