ok dumb question...but I need help
Posted: Sun Sep 07, 2003 3:56 pm
I suck at this so if anyone want to volenteer to help I would apreciate it greatly.
OK the dumb question:
how would you write the following code so it would work under php 4.2+:
just a simple html form passing the data to this php script. It saves the a file for each time a user fills out the form. I then can go back and view edit or delete the file from within the browser.
Mainly just the fput section. ...and for some reason the encludes work great on my virtual host but not on my dev machine. I have read the sticky on passing variables in 4.2 but I just do not get it.
Any help would really be apreciate. I mean really really!
TIA
Wes/[
OK the dumb question:
how would you write the following code so it would work under php 4.2+:
Code: Select all
<?php
if(isset($go)){
$file = "$fn.$mid.csv";
$contents = stripslashes("$date;$initials;$servicepro;$mid;$businessname;$address;$city;$state;$zip;$phone;$contact;$shippingnotes;$notes;$sup1;$qty1;$sup2;$qty2;$sup3;$qty3;$sup4;$qty4;$sup5;$qty5;$sup6;$qty6;$sup7;$qty7");
$fp = fopen("$file","a+");
fputs($fp, "$contents");
fclose($fp);
}
if(isset($del)){
unlink("$del");
}
if(isset($edit)){
$file = "$note";
$contents = stripslashes("$date;$initials;$servicepro;$mid;$businessname;$address;$city;$state;$zip;$phone;$contact;$shippingnotes;$notes;$sup1;$qty1;$sup2;$qty2;$sup3;$qty3;$sup4;$qty4;$sup5;$qty5;$sup6;$qty6;$sup7;$qty7");
unlink("$note");
$fp = fopen("$file","w+");
fputs($fp, "$contents");
fclose($fp);
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Blue Slip v1.0</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php
if(isset($go)){
echo "<meta http-equiv="refresh" content="0;URL=index.php">";
}
if(isset($del)){
echo "<meta http-equiv="refresh" content="0;URL=index.php">";
}
else{
echo "<meta http-equiv="refresh" content="2;URL=javascript:window.close()">";
}
?>
</head>
<body text="#FFFFFF" link="#FFFF00" vlink="#FFFF00" alink="#FFFF00" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle"><font size="2" color="#003366" face="Verdana">[ Blue Slip has been submitted ]</font><br>
<font size="2" color="#003366" face="Verdana">[ Thank you ! ]</font>
</tr>
</table>
</div>
</body>
</html>Mainly just the fput section. ...and for some reason the encludes work great on my virtual host but not on my dev machine. I have read the sticky on passing variables in 4.2 but I just do not get it.
Any help would really be apreciate. I mean really really!
TIA
Wes/[