signature16 Posted February 16, 2007 Share Posted February 16, 2007 I am trying to setup this script but for some reason Internet Explorer won't post the data. When I submit the data, it is like I typed the URL to the actions pages in. It doesn't do anything it is supposed to do. On Firefox it works perfectly. Internet Explorer won't post the data when I click the "Submit" link...or when I hit enter on the keyboard. I'm not sure whats wrong. The Submit button is at the very bottom of the code part. Can somebody please help me? Thanks so much! <form method=POST action="<?php $_SERVER['PHP_SELF'];?>"> <table border=0> <tr> <td colspan="6"><strong>General Information:</strong> </td> </tr> <tr> <td width="131">Name:</td> <td width="144"><input type=text name='storename' value='<? echo $storename; ?>' /> </td> <td width="221" colspan="4" align=right valign="top"><a href="images/public-add/name.gif" rel="lightbox" title="Personal Name"><img alt="" src="images/help.gif"/></a> </td> </tr> <tr> <td>Phone:</td> <td><input type="text" name='phone' value='<? echo $phone; ?>' /></td> <td colspan="4" align=right valign="top"><a href="images/public-add/phone.gif" rel="lightbox" title="Phone Number"><img alt="" src="images/help.gif"/></a> </td> </tr> <?php /*?><tr> <td>Website or Email: </td> <td><input type="text" name='url' value='<? if ($url == '') { echo "http://"; } else { echo $url; } ?>' /> <br /> <span style="font-size:8pt;"> <br />If you adding an email please add: mailto: in front of it.<br /> E.G. mailto:[email protected] </span> </td> <td colspan="4" align=right valign="top"> <a href="images/public-add/name.gif" rel="lightbox" title="Your Personal or Clinic Name will be linked to this email."><img alt="" src="images/help.gif"/></a> </td> </tr> <?php */?> <tr> <td>Hours:</td> <td> <input type="text" name='hours' value="<? echo $hours; ?>" /> </td> <td colspan="4" align="right" valign="top"><a href="images/public-add/hours.gif" rel="lightbox" title=""><img alt="" src="images/help.gif"/></a> </td> </tr> <tr> <td>Email:</td> <td> <input type="text" name="emailConfirm" value="<? echo $emailConfirm; ?>" /> </tr> <tr> <td colspan="6"><br /><strong>Address:</strong></td> </tr> <tr> <td>Street Address:</td> <td><input type=text name='street' value='<?php echo $address; ?>' /></td> <td colspan="4" align=right valign="top"><a href="images/public-add/street-address.gif" rel="lightbox" title=""><img alt="" src="images/help.gif"/></a> </td> </tr> <tr> <td>City</td> <td><input type=text name='city' value='<?php echo $city; ?>' /></td> <td colspan="4" align=right valign="top"><a href="images/public-add/city-state-zip.gif" rel="lightbox" title=""><img alt="" src="images/help.gif"/></a> </td> </tr> <tr> <td>State:</td> <td><input type=text name='state' value='<? echo $state; ?>' /></td> <td colspan="4" align=right valign="top"><a href="images/public-add/city-state-zip.gif" rel="lightbox" title=""><img alt="" src="images/help.gif"/></a> </td> </tr> <tr> <td>Zip Code: </td> <td><input type=text name='zip' value='<? echo $zip; ?>' /></td> <td colspan="4" align=right valign="top"><a href="images/public-add/city-state-zip.gif" rel="lightbox" title=""><img alt="" src="images/help.gif"/></a> </td> </tr> <tr> <td>Country:</td> <td><? echo show_country_codes(); ?></td> <td colspan="4" align=right valign="top"><a href="images/public-add/city-state-zip.gif" rel="lightbox" title=""><img alt="" src="images/help.gif"/></a></td> </tr> <tr> <td> </td> <td> <input type="image" src="images/submit.gif" style="width:104px; height:24px; margin-top:15px;" name="submit" value="Submit Location" /> </td> <td colspan="4"></td> </tr> </table> </form> Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/ Share on other sites More sharing options...
papaface Posted February 17, 2007 Share Posted February 17, 2007 change <form method=POST action="<?php $_SERVER['PHP_SELF'];?>"> to <form method=POST action="<?php $_SERVER['PHP_SELF'] ?>"> see if that makes any difference. Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186720 Share on other sites More sharing options...
signature16 Posted February 17, 2007 Author Share Posted February 17, 2007 papface: thanks for the quick reply. Same problem even after I changed that. Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186722 Share on other sites More sharing options...
marcus Posted February 17, 2007 Share Posted February 17, 2007 Try looking at your code. <?php <tr> Try echoing that until you reach the if statement. Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186724 Share on other sites More sharing options...
signature16 Posted February 17, 2007 Author Share Posted February 17, 2007 mgallforever: what do you mean? Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186725 Share on other sites More sharing options...
sspoke Posted February 17, 2007 Share Posted February 17, 2007 well submit is a image what you mean won't post you mean internet explorer doesnt refresh the page? thats not a PHP problem thats a html problem Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186726 Share on other sites More sharing options...
marcus Posted February 17, 2007 Share Posted February 17, 2007 You're putting HTML into a PHP statement without echoing or printing it. <?php echo "<tr>"; //rest of your code Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186728 Share on other sites More sharing options...
papaface Posted February 17, 2007 Share Posted February 17, 2007 This may be why: change <form method=POST action="<?php $_SERVER['PHP_SELF'];?>"> to <form method="POST" action="<?php $_SERVER['PHP_SELF'] ?>"> Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186730 Share on other sites More sharing options...
marcus Posted February 17, 2007 Share Posted February 17, 2007 How does that differ from your previous post? It wouldn't matter if POST was surrounded by quotes unless he was following a DOCTYPE. Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186731 Share on other sites More sharing options...
sspoke Posted February 17, 2007 Share Posted February 17, 2007 the POST has quotes now Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186732 Share on other sites More sharing options...
papaface Posted February 17, 2007 Share Posted February 17, 2007 How does that differ from your previous post? It wouldn't matter if POST was surrounded by quotes unless he was following a DOCTYPE. IE can be picky Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186734 Share on other sites More sharing options...
marcus Posted February 17, 2007 Share Posted February 17, 2007 You're better off doing: <?php echo "<form method=post action='$_SERVER[php_SELF]'>\n"; ?> Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186735 Share on other sites More sharing options...
sspoke Posted February 17, 2007 Share Posted February 17, 2007 o just looknig at the code I see <?php <tr> wtf? just remove the <?php and it should work tested it stilll doesn't print submit button but it loads more of the page now.. General Information: Name: Phone: Website or Email: If you adding an email please add: mailto: in front of it. E.G. mailto:[email protected] Hours: Email: Address: Street Address: City State: Zip Code: Country: Fatal error: Call to undefined function: show_country_codes() in C:\www\aa.php on line 88 Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186737 Share on other sites More sharing options...
ataria Posted February 17, 2007 Share Posted February 17, 2007 the POST has quotes now I never code with quotes, and all my scripts work. quotes don't do anything. Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186738 Share on other sites More sharing options...
marcus Posted February 17, 2007 Share Posted February 17, 2007 And you have some minor issues. if ($url == '') { echo "http://"; } Change that to: if(empty($url)){ //or !isset($url){ echo "http://"; } Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186740 Share on other sites More sharing options...
sspoke Posted February 17, 2007 Share Posted February 17, 2007 Cuz look <?php <tr> <td>Website or Email: </td> <td><input type="text" name='url' value='<? if ($url == '') you see you started a <?php but you never put anything in it or even closed it than you start a new php with a shorttag <? whats the point of that? Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186743 Share on other sites More sharing options...
marcus Posted February 17, 2007 Share Posted February 17, 2007 And you're also wasting space by using <?php echo $var ?> You can use the shorthand <?=$var?> Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186744 Share on other sites More sharing options...
signature16 Posted February 17, 2007 Author Share Posted February 17, 2007 I removed that weird <?php <tr> thing. I think it was just a mistake with me trying to comment stuff out. Here is the updated code, which still doesn't work. <form method="POST" action="<?php $_SERVER['PHP_SELF'] ?>"> <table border=0> <tr> <td colspan="6"><strong>General Information:</strong> </td> </tr> <tr> <td width="131">Name:</td> <td width="144"><input type=text name='storename' value='<? echo $storename; ?>' /> </td> <td width="221" colspan="4" align=right valign="top"><a href="images/public-add/name.gif" rel="lightbox" title="Personal Name"><img alt="" src="images/help.gif"/></a> </td> </tr> <tr> <td>Phone:</td> <td><input type="text" name='phone' value='<? echo $phone; ?>' /></td> <td colspan="4" align=right valign="top"><a href="images/public-add/phone.gif" rel="lightbox" title="Phone Number"><img alt="" src="images/help.gif"/></a> </td> </tr> <tr> <td>Hours:</td> <td> <input type="text" name='hours' value="<? echo $hours; ?>" /> </td> <td colspan="4" align="right" valign="top"><a href="images/public-add/hours.gif" rel="lightbox" title=""><img alt="" src="images/help.gif"/></a> </td> </tr> <tr> <td>Email:</td> <td> <input type="text" name="emailConfirm" value="<? echo $emailConfirm; ?>" /> </tr> <tr> <td colspan="6"><br /><strong>Address:</strong></td> </tr> <tr> <td>Street Address:</td> <td><input type=text name='street' value='<?php echo $address; ?>' /></td> <td colspan="4" align=right valign="top"><a href="images/public-add/street-address.gif" rel="lightbox" title=""><img alt="" src="images/help.gif"/></a> </td> </tr> <tr> <td>City</td> <td><input type=text name='city' value='<?php echo $city; ?>' /></td> <td colspan="4" align=right valign="top"><a href="images/public-add/city-state-zip.gif" rel="lightbox" title=""><img alt="" src="images/help.gif"/></a> </td> </tr> <tr> <td>State:</td> <td><input type=text name='state' value='<? echo $state; ?>' /></td> <td colspan="4" align=right valign="top"><a href="images/public-add/city-state-zip.gif" rel="lightbox" title=""><img alt="" src="images/help.gif"/></a> </td> </tr> <tr> <td>Zip Code: </td> <td><input type=text name='zip' value='<? echo $zip; ?>' /></td> <td colspan="4" align=right valign="top"><a href="images/public-add/city-state-zip.gif" rel="lightbox" title=""><img alt="" src="images/help.gif"/></a> </td> </tr> <tr> <td>Country:</td> <td><? echo show_country_codes(); ?></td> <td colspan="4" align=right valign="top"><a href="images/public-add/city-state-zip.gif" rel="lightbox" title=""><img alt="" src="images/help.gif"/></a></td> </tr> <tr> <td> </td> <td> <input type="image" src="images/submit.gif" style="width:104px; height:24px; margin-top:15px;" name="submit" value="Submit Location" /></td> <td colspan="4"></td> </tr> </table> </form> thanks so much for the help so far everybody. Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186745 Share on other sites More sharing options...
ataria Posted February 17, 2007 Share Posted February 17, 2007 Okay. Let's look back. Can't you just type in the stupid URL instead of using the php_self? I mean, c'mon. Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186746 Share on other sites More sharing options...
sspoke Posted February 17, 2007 Share Posted February 17, 2007 I just tested your new code I commented out the function show_country_codes and I see a image I can click it and it does Post data your main script is missing $_POST['Get stuff'] .. Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186748 Share on other sites More sharing options...
marcus Posted February 17, 2007 Share Posted February 17, 2007 Your main problem is that you haven't defined the variables from what you've given us. Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186749 Share on other sites More sharing options...
sspoke Posted February 17, 2007 Share Posted February 17, 2007 O I see what you want to do No idea why but you want after a user refreshes the page his posted data stays there just replace <? echo $emailConfirm; ?> <? echo $phone; ?> <? echo $storename; ?> etc... the left overs to.. <? echo $_POST['storename']; ?> just for testing see if it posts you should see the same data after you submit the page after it refreshes Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186750 Share on other sites More sharing options...
signature16 Posted February 17, 2007 Author Share Posted February 17, 2007 ataria: same error even after i put the full URL in. Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186751 Share on other sites More sharing options...
ataria Posted February 17, 2007 Share Posted February 17, 2007 ataria: same error even after i put the full URL in. If it's... www.yoursite.com/index.php you just gotta do.. index.php Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186753 Share on other sites More sharing options...
signature16 Posted February 17, 2007 Author Share Posted February 17, 2007 sspoke: <? echo $_POST['storename']; ?> When I put that at the top of the page, it posts the storename in IE and FF. Link to comment https://forums.phpfreaks.com/topic/38838-internet-explorer-wont-post/#findComment-186757 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.