Jump to content

Recommended Posts

on clicking 'register' with no details, i get:

 

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/seyeide/public_html/nzmarketplace/includes/reg_val.php on line 10

 

also, have a look at your use of addslashes (or mysql_real_escape_string, whichever you're using). when you pass values back to an input field as a default value, or to generally display it on the screen, you need to remove the slashes again else it a) looks messy and b) gives user clues as to what methods you're using to clean up the input. My personal preference (as opposed to stripslashes) is not to treat/clean the $_POST array directly, rather I leave the $_POST array as it is and use something like $post = deepclean($_POST); (deepclean being my own function that does the adding of slashes as required).

 

Then, for redisplaying on the screen or in input boxes, look at htmlspecialchars() such as

 

<input name="username" type="text" value="<?=htmlspecialchars($_POST['username']) ?>" />

×
×
  • 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.