Jump to content

Recommended Posts

Hi all,

I have a strange conundrum. I have a simple html form with a php script that updates a mysql database. The page has a standard 

www.h...com/xyz.php

format. It loads and functions fine in firefox but when you type the address into Internet Explorer, it says it can't find the file. Anyone have any ideas as to why that may be? I contacted the web host and was told to submit a scripting ticket that may take 4 days (in other words, they were no help). I know there will be someone here who can help...this place never fails me! Thanks in advance!

 

Green

As requested, here is the code. The DOCTYPE should be correct as I created it in dreamweaver and began it as a php file. Once again, thanks in advance.

 

Green

 

<?php
if(isset($_POST['update']))
{
$title=$_POST['title'];
$desc=$_POST['desc'];
$ingr1=$_POST['ingr1'];
$ingr2=$_POST['ingr2'];
$ingr3=$_POST['ingr3'];
$ingr4=$_POST['ingr4'];
$ingr5=$_POST['ingr5'];
$ingr6=$_POST['ingr6'];
$ingr7=$_POST['ingr7'];
$ingr8=$_POST['ingr8'];
$ingr9=$_POST['ingr9'];
$ingr10=$_POST['ingr10'];
$ingr11=$_POST['ingr11'];
$ingr12=$_POST['ingr12'];
$ingr13=$_POST['ingr13'];
$ingr14=$_POST['ingr14'];
$ingr15=$_POST['ingr15'];
$ingr16=$_POST['ingr16'];
$ingr17=$_POST['ingr17'];
$ingr18=$_POST['ingr18'];
$ingr19=$_POST['ingr19'];
$ingr20=$_POST['ingr20'];
$ingr21=$_POST['ingr21'];
$ingr22=$_POST['ingr22'];
$ingr23=$_POST['ingr23'];
$ingr24=$_POST['ingr24'];
$ingr25=$_POST['ingr25'];
$instructions=$_POST['instructions'];
$cps=$_POST['cps'];
$ss=$_POST['ss'];
$cal=$_POST['cal'];
$fat=$_POST['fat'];
$satfat=$_POST['satfat'];
$carbs=$_POST['carbs'];
$sugar=$_POST['sugar'];
$sodium=$_POST['sodium'];
$protein=$_POST['protein'];
$fiber=$_POST['fiber'];

if(!get_magic_quotes_gpc())
{
$title=addslashes($title);
$desc=addslashes($desc);
$ingr1=addslashes($ingr1);
$ingr2=addslashes($ingr2);
$ingr3=addslashes($ingr3);
$ingr4=addslashes($ingr4);
$ingr5=addslashes($ingr5);
$ingr6=addslashes($ingr6);
$ingr7=addslashes($ingr7);
$ingr8=addslashes($ingr8);
$ingr9=addslashes($ingr9);
$ingr10=addslashes($ingr10);
$ingr11=addslashes($ingr11);
$ingr12=addslashes($ingr12);
$ingr13=addslashes($ingr13);
$ingr14=addslashes($ingr14);
$ingr15=addslashes($ingr15);
$ingr16=addslashes($ingr16);
$ingr17=addslashes($ingr17);
$ingr18=addslashes($ingr18);
$ingr19=addslashes($ingr19);
$ingr20=addslashes($ingr20);
$ingr21=addslashes($ingr21);
$ingr22=addslashes($ingr22);
$ingr23=addslashes($ingr23);
$ingr24=addslashes($ingr24);
$ingr25=addslashes($ingr25);
$instructions=addslashes($instructions);
$cps=addslashes($cps);
$ss=addslashes($ss);
$cal=addslashes($cal);
$fat=addslashes($fat);
$satfat=addslashes($satfat);
$carbs=addslashes($carbs);
$sugar=addslashes($sugar);
$sodium=addslashes($sodium);
$protein=addslashes($protein);
$fiber=addslashes($fiber);
}
include 'config.php';

$query= "INSERT INTO recipes (title, description, ingr_1, ingr_2, ingr_3, ingr_4, ingr_5, ingr_6, ingr_7, ingr_8, ingr_9, ingr_10, ingr_11, ingr_12, ingr_13, ingr_14, ingr_15, ingr_16, ingr_17, ingr_18, ingr_19, ingr_20, ingr_21, ingr_22, ingr_23, ingr_24, ingr_25, instructions, cps, ss, cal, fat, satfat, carbs, sugar, sodium, protein, fiber)"."VALUES ('$title', '$description', '$ingr1', '$ingr2', '$ingr3', '$ingr4', '$ingr5', '$ingr6', '$ingr7', '$ingr8', '$ingr9', '$ingr10', '$ingr11', '$ingr12', '$ingr13', '$ingr14', '$ingr15', '$ingr16', '$ingr17', '$ingr18', '$ingr19', '$ingr20', '$ingr21', '$ingr22', '$ingr23', '$ingr24', '$ingr25', '$instructions', '$cps', '$ss', '$cal', '$fat', '$satfat', '$carbs', '$sugar', '$sodium', '$protein', '$fiber')";
mysql_query($query) or die('Error ,query failed');

mysql_close($link);

print $title . " has been added to the database.";	
}

?>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>healthy lifestyle gourmet</title>
<style type="text/css">
.conlink a {font-family:Geneva, Arial, Helvetica, sans-serif; font-size:14px; border:1px solid #000000; background-color:#cddf77; color:#000000; text-decoration:none; position:absolute; left:560px; height:18px; width:160px; padding-left:2px; padding-right:2px; text-align:center;}
.conlink a:hover {font-family:Geneva, Arial, Helvetica, sans-serif; font-size:14px; border:1px solid black; background-color:#000000; color:#cddf77; text-decoration:none; position:absolute; left:560px; height:18px; width:160px; padding-left:2px; padding-right:2px; text-align:center;}
</style>
</head>

<body>



<form method="post" action="<?php echo $PHP_SELF;?>">
<table cellpadding="2" cellspacing="1" align="center" width="960">
<tr>
<td class="conlink" colspan="2"><a href="/hlgcon.php" target="_self">List database contents</a></td>
</tr>
<tr>
<td> </td>
</tr>
<th colspan="8">Add Recipe:</th>
<tr>
<td width="100">Title</td><td><input name="title" type="text" /></td>
</tr>
<tr>
<td width="100">description</td><td colspan="4"><textarea name="desc" cols="50" rows="5"></textarea></td>
</tr>
<tr>
<td width="100">Ingr. 1</td><td><input name="ingr1" type="text" /></td>
    <td width="100">Ingr. 2</td><td><input name="ingr2" type="text" /></td>
    <td width="100">Ingr. 3</td><td><input name="ingr3" type="text" /></td>
    <td width="100">Ingr. 4</td><td><input name="ingr4" type="text" /></td>
</tr>
<tr>
<td width="100">Ingr. 5</td><td><input name="ingr5" type="text" /></td>
    <td width="100">Ingr. 6</td><td><input name="ingr6" type="text" /></td>
    <td width="100">Ingr. 7</td><td><input name="ingr7" type="text" /></td>
    <td width="100">Ingr. 8</td><td><input name="ingr8" type="text" /></td>
</tr>
<tr>
<td width="100">Ingr. 9</td><td><input name="ingr9" type="text" /></td>
    <td width="100">Ingr. 10</td><td><input name="ingr10" type="text" /></td>
    <td width="100">Ingr. 11</td><td><input name="ingr11" type="text" /></td>
    <td width="100">Ingr. 12</td><td><input name="ingr12" type="text" /></td>
</tr>
<tr>
<td width="100">Ingr. 13</td><td><input name="ingr13" type="text" /></td>
    <td width="100">Ingr. 14</td><td><input name="ingr14" type="text" /></td>
    <td width="100">Ingr. 15</td><td><input name="ingr15" type="text" /></td>
    <td width="100">Ingr. 16</td><td><input name="ingr16" type="text" /></td>
</tr>
<tr>
<td width="100">Ingr. 17</td><td><input name="ingr17" type="text" /></td>
    <td width="100">Ingr. 18</td><td><input name="ingr18" type="text" /></td>
    <td width="100">Ingr. 19</td><td><input name="ingr19" type="text" /></td>
    <td width="100">Ingr. 20</td><td><input name="ingr20" type="text" /></td>
</tr>
<tr>
<td width="100">Ingr. 21</td><td><input name="ingr21" type="text" /></td>
    <td width="100">Ingr. 22</td><td><input name="ingr22" type="text" /></td>
    <td width="100">Ingr. 23</td><td><input name="ingr23" type="text" /></td>
    <td width="100">Ingr. 24</td><td><input name="ingr24" type="text" /></td>
</tr>
<tr>
<td width="100">Ingr. 25</td><td><input name="ingr25" type="text" /></td>
</tr>
<tr>
<td width="100">Instructions</td>
<td colspan="8"><textarea name="instructions" cols="104" rows="10"></textarea></td>
</tr>
<tr>
<td width="100">Cals/serving</td><td><input name="cps" type="text" /></td>
    <td width="100">serving size</td><td><input name="ss" type="text" /></td>
    <td width="100">Calories</td><td><input name="cal" type="text" /></td>
    <td width="100">Total fat</td><td><input name="fat" type="text" /></td>
</tr>
<tr>
<td width="100">Saturated fat</td><td><input name="satfat" type="text" /></td>
    <td width="100">Carbohydrates</td><td><input name="carbs" type="text" /></td>
    <td width="100">Sugar</td><td><input name="sugar" type="text" /></td>
    <td width="100">Sodium</td><td><input name="sodium" type="text" /></td>
</tr>
<tr>
<td width="100">protein</td><td><input name="protein" type="text" /></td>
    <td width="100">fiber</td><td><input name="fiber" type="text" /></td>
</tr>
<tr>
<td colspan="8" align="center"><input name="update" type="submit" value="add recipe" /></td>
</tr>
</table>
</form>

<br /><br />
   
   	
</body>
</html>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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