Forum Moderators: coopster

Message Too Old, No Replies

Need a little code help and advice please

         

Smad

3:26 pm on Jan 27, 2004 (gmt 0)

10+ Year Member



Hi all

Firstly I have a form that takes details for entering into a DB, problem 1 is if not all fields are filled it says click to go back and complete the form but its reset all fields to blank. please how do you stop this?

now my code prob :/
it only deletes one image although sometimes theres more? any ideas why its not looping through removing all images please.

$tot = 6;
$num = 0;
for($q=0;$q<$tot;$q++){
$old_image = mysql_query("SELECT picture".$num." FROM brokerage WHERE id = '$boat'",$conn);

$field = "picture".$num."";
$picture_result = mysql_result($old_image,$id,$field);

@unlink($picture_result);

thanks all

Smad

3:46 pm on Jan 27, 2004 (gmt 0)

10+ Year Member



ok i sorted the code problem but still need a some direction regarding blank fields please

jatar_k

8:47 pm on Jan 27, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



if not all fields are filled it says click to go back and complete the form but its reset all fields to blank. please how do you stop this?

I would assume that it should be in the error checking near the top of the script. It will also depend on what you want it to do instead. It is just a matter of rebuilding the logic of the error checking section.

Want to post the piece of code (short) that is doing the error checking or outputting the "Go Back and fill out ...." message.

Smad

11:23 pm on Jan 27, 2004 (gmt 0)

10+ Year Member



i am gonna probably opt for a little javascript to make sure the fields are filled, its this problem which means when 'back' is clicked and they are re-presented the form which is then empty, so if i can stop it before its submitted i guess thats the best solution.

jatar_k

12:30 am on Jan 28, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you could also just reinclude the form and echo the values into the appropriate form elements.