nonner
10-1-05, 09:24 PM
I have a script that stopped working when the globals were changed. (Really don't know what that means but it did stop working after 8/05 changes)
After someone fills out the form, I am supposed to have the information written to a table in my SQL and that information is mailed to me. The information consists of submission data and http links to uploaded files.
Since the global changes I receive emails but the SQL table is not updated and files are not uploading.
The form is an html document and it calls PHP file called process.php.
I am assuming that the problem lies in the last few lines of the process.php file but I do not know how to make it c omply with the changes at PowWeb.
I did install a php.ini file in root of html and un-remark register_globals = on.
This did not fix the problem. I still get no SQL table update and no file upload.
Any help or direction where to look for a solution is appreciated.
The process.php file code follows.
<?php
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
$about=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $about);if($name=="" || $username=="" || $height=="" || $hair=="" || $measurement=="" || $weight=="" || $eyecolor=="" || $dressize=="" || $city=="" || $state=="" || $about=="" || $keyword=="" || $name=="" || $email=="" || $upload=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if(!is_uploaded_file($upload)){
$error.="<li>The file, ".$upload_name.", was not uploaded!";
$errors=1;
}
if($errors==1) echo $error;
else{
$image_part = date("h_i_s")."_".$upload_name;
$image_list[14] = $image_part;
copy($upload, "files/".$image_part);
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="name: ".$name."
username: ".$username."
height: ".$height."
hair: ".$hair."
measurement: ".$measurement."
weight: ".$weight."
eyecolor: ".$eyecolor."
dressize: ".$dressize."
city: ".$city."
state: ".$state."
about: ".$about."
keyword: ".$keyword."
name: ".$name."
email: ".$email."
upload: ".$where_form_is."files/".$image_list[14]."
";
mail("my_email@yahoo.com","Submission Applicant",$message,"From: Submission Applicant");
$link = mysql_connect("mysql02.powweb.com","sql_member_name","sql_password");
mysql_select_db("sql_database_name",$link);
$query="insert into sql_table _name(stagename,username,height,hair,measurement,w eight,eyecolor,dressize,city,state,about,keyword,n ame,email,upload) values ('".$name."','".$username."','".$height."','".$hair."','".$measurement."','".$weight."','".$eyecolor."','".$dressize."','".$city."','".$state."','".$about."','".$keyword."','".$name."','".$email."','".$where_form_is."files/".$image_list[14]."')";
mysql_query($query);
header("Refresh: 0;url=thanks.html");
}
?>
After someone fills out the form, I am supposed to have the information written to a table in my SQL and that information is mailed to me. The information consists of submission data and http links to uploaded files.
Since the global changes I receive emails but the SQL table is not updated and files are not uploading.
The form is an html document and it calls PHP file called process.php.
I am assuming that the problem lies in the last few lines of the process.php file but I do not know how to make it c omply with the changes at PowWeb.
I did install a php.ini file in root of html and un-remark register_globals = on.
This did not fix the problem. I still get no SQL table update and no file upload.
Any help or direction where to look for a solution is appreciated.
The process.php file code follows.
<?php
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
$about=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $about);if($name=="" || $username=="" || $height=="" || $hair=="" || $measurement=="" || $weight=="" || $eyecolor=="" || $dressize=="" || $city=="" || $state=="" || $about=="" || $keyword=="" || $name=="" || $email=="" || $upload=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if(!is_uploaded_file($upload)){
$error.="<li>The file, ".$upload_name.", was not uploaded!";
$errors=1;
}
if($errors==1) echo $error;
else{
$image_part = date("h_i_s")."_".$upload_name;
$image_list[14] = $image_part;
copy($upload, "files/".$image_part);
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="name: ".$name."
username: ".$username."
height: ".$height."
hair: ".$hair."
measurement: ".$measurement."
weight: ".$weight."
eyecolor: ".$eyecolor."
dressize: ".$dressize."
city: ".$city."
state: ".$state."
about: ".$about."
keyword: ".$keyword."
name: ".$name."
email: ".$email."
upload: ".$where_form_is."files/".$image_list[14]."
";
mail("my_email@yahoo.com","Submission Applicant",$message,"From: Submission Applicant");
$link = mysql_connect("mysql02.powweb.com","sql_member_name","sql_password");
mysql_select_db("sql_database_name",$link);
$query="insert into sql_table _name(stagename,username,height,hair,measurement,w eight,eyecolor,dressize,city,state,about,keyword,n ame,email,upload) values ('".$name."','".$username."','".$height."','".$hair."','".$measurement."','".$weight."','".$eyecolor."','".$dressize."','".$city."','".$state."','".$about."','".$keyword."','".$name."','".$email."','".$where_form_is."files/".$image_list[14]."')";
mysql_query($query);
header("Refresh: 0;url=thanks.html");
}
?>