PHP - Submit Form Works With Internet Explorer But Not With Firefox 7 Or Chrome
I have been banging my head for quite a number of hours on this.........I am getting the below error with firefox 7 or chrome but NOT with IE
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/unlockth/public_html/motorola/insertmoto.php on line 35 Here is the code.......pls can anyone help me? <?php $userip = ($_SERVER['X_FORWARDED_FOR']) ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; $name = $_POST['name'] ; $email = $_POST['email'] ; $phone = $_POST['phone'] ; $operator = $_POST['operator'] ; $imei = $_POST['imei'] ; $todayis = date("l, F j, Y, g:i a") ; @mail( "xxx@xxx.com", "ORDER SUBMISSION", $message = " $userip $message = $todayis Name: $name Email: $email Phone Model: $phone Phone Operator: $operator Phone Imei: $imei", "From: MOTOROLA SUBMISSION>"); ?> <? $id = $_POST['id']; include "/home/unlockth/password.php"; mysql_select_db("unlockth_unlocking",$db); mysql_query("INSERT INTO custdetails VALUES ('','$name','$email','$phone','$operator','$imei')"); $insertid = mysql_insert_id(); include "/home/unlockth/password.php"; mysql_select_db("unlockth_unlocking",$db); $getdata = mysql_query("SELECT * FROM motorola WHERE id=$id", $db); $row = mysql_fetch_array($getdata); $title = $row["title"]; $price_1 = $row["price_1"]; $price_2 = $row["price_2"]; $price_3 = $row["price_3"]; $imageaddr = $row["imageaddr"]; $description = $row["description"]; $keywords = $row["keywords"]; $time = $row["time"]; include '/home/unlockth/public_html/motorola/outputmotocode.php';?> Similar TutorialsThis topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=346255.0 I have this form action that checks for errors, if none are found it should go to the confirmation page. Works well in Firefox, however Chrome stays perpetually on the register page. Is there any way to make this work in Chrome as well? Does anyone have any explanation? Thank you very much for your time. Code: [Select] <form action="<?php if(!empty($errors)){ echo "confirmation.php"; } else { echo "register.php"; } ?>" method="POST"> hi, I try to login through a form but when I click the button it does nothing in firefox7 and chrome. It works fine in IE. here's the code: Code: [Select] $a=""; $b=""; if ($_POST) { $a=trim($_POST["id"]); $b=trim($_POST["password"]); $a=str_replace("'","",$a); $b=str_replace("'","",$b); $a=str_replace("\"","",$a); $b=str_replace("\"","",$b); } if ($a=="" || $b=="") { if ($_SESSION["id_session"]=="" || $_SESSION["password_session"]=="") { ?> <form action=members.php method=post> <br><br><Center><table><tr><td colspan=2 align=center><h3>Members Login Area</h3></td></tr> <tr><td>Member's ID</td><td><input type=text name=id></td></tr> <tr><td>Password</td><td><input type=password name=password></td></tr> <tr><td> </td><td> <a href="forgot.php" onclick="doexit=false;"><font face="Verdana,Arial,Helvetica" size="1" color="#000000"><b>Forgot Your Password?</b></font></a></td></tr> <tr><td colspan=2 align=center><input type=submit value="Log In"></td></tr> </table></form> <? } else { middle(); } } else { $check=0; $id=$_POST["id"]; $rs = mysql_query("select * from members where ID='$id'"); if ($rs) { $arr=mysql_fetch_array($rs); $n2=$arr['Password']; if ($n2==$b) { $check=1; $_SESSION["id_session"]=$arr[0]; $_SESSION["password_session"]=$arr[9]; middle(); } } if ($check==0) { print "<h2>Invalid User Id or Password</h2>"; ?> <form action=members.php method=post> <br><br><Center><table><tr><td colspan=2 align=center><h3>Members Login Area</h3></td></tr> <tr><td>Member's ID</td><td><input type=text name=id></td></tr> <tr><td>Password</td><td><input type=password name=password></td></tr> <tr><td> </td><td> <a href="forgot.php" onclick="doexit=false;"><font face="Verdana,Arial,Helvetica" size="1" color="#000000"><b>Forgot Your Password?</b></font></a></td></tr> <tr><td colspan=2 align=center><input type=submit value="Log In"></td></tr> </table></form> <? } } thanks Here is the scenario: I have phpbb installed inside of an iframe and I have all of these features working .....in firefox only: Iframe re-sizes to fit content external links within the forum open in a new window traffic to my /forum directory is redirected (with a javascript window.location.replace) to open inside of the iframe Essentially phpbb works perfectly in firefox When I load it in either Chrome or IE: My site index will load fine (as will any site feature that is not within the iframe) When I attempt to load my forum or request anything within the iframe IE and Chrome show the page for less than one second then continuously load a 404 page within the frame This leads me to believe that it is a problem with my redirect...but I have no clue. Here is the PHP, hopefully somebody can help: Iframe re-size code (in iframefile.php): <script type="text/javascript"> /*********************************************** * IFrame SSI script II- &#169; Dynamic Drive DHTML code library (http://www.dynamicdrive.com) * Visit DynamicDrive.com for hundreds of original DHTML scripts * This notice must stay intact for legal use ***********************************************/ //Input the IDs of the IFRAMES you wish to dynamically resize to match its content height: //Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none: var iframeids=["myframe"] //Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended): var iframehide="yes" var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1] var FFextraHeight=parseFloat(getFFVersion)>=0.1? 150 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers function resizeCaller(){ var dyniframe=new Array() for (i=0; i<iframeids.length; i++){ if (document.getElementById) resizeIframe(iframeids[i]) //reveal iframe for lower end browsers? (see var above): if ((document.all || document.getElementById) && iframehide=="no"){ var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i]) tempobj.style.display="block" } } } function resizeIframe(frameid){ var currentfr=document.getElementById(frameid) if (currentfr && !window.opera){ currentfr.style.display="block" if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax currentfr.height = currentfr.Document.body.scrollHeight; if (currentfr.addEventListener) currentfr.addEventListener("load", readjustIframe, false) else if (currentfr.attachEvent){ currentfr.detachEvent("onload", readjustIframe) // Bug fix line currentfr.attachEvent("onload", readjustIframe) } } } function readjustIframe(loadevt) { var crossevt=(window.event)? event : loadevt var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement if (iframeroot) resizeIframe(iframeroot.id); } function loadintoIframe(iframeid, url){ if (document.getElementById) document.getElementById(iframeid).src=url } if (window.addEventListener) window.addEventListener("load", resizeCaller, false) else if (window.attachEvent) window.attachEvent("onload", resizeCaller) else window.onload=resizeCaller </script> _________________________________________________ ___ This is (part of) the javascript redirect (in iframefile.php) <script type="text/javascript"> var text = window.location.href; function delineate(str) { theleft = str.indexOf("=") + 1; theright = str.indexOf("&"); return(str.substring(theleft, str.length)); } url=delineate(text) function refreshFrame() { myframe.location.replace("http://www.mydomain/?var1='+window.location.href+'"); } </script> This is the other part of the above javascript redirect that is in the overall_header to redirect pages requested within the forum to target the iframe via the code above: <script type="text/javascript"> if (window == top) { var url='window.location.replace("/?var1='+window.location.href+'")'; eval(url); } </script> This is the necessary code i had to add in my home directory index.php for the above two codes to work: <? ob_start(); $vary = $_GET['var1']; $tee = $_GET['t']; if ( $vary == "" ) { // do nothing, no var } else { $gogogo = strtolower($vary); $healthy = array("http://mydomain/forum/", "http://www.mydomain/forum/"); $yummy = array("", ""); $newphrase = str_replace($healthy, $yummy, $gogogo); $finalcode = base64_encode($newphrase); $healthy = array("+", "="); $yummy = array("7PLUS7", "7EQUALS7"); $newphraseu = str_replace($healthy, $yummy, $finalcode); if ( $tee == "" ) { header("Location: http://www.mydomain/iframefile.php?var=$newphraseu"); } else { header("Location: http://www.mydomain/iframefile.php?var=$newphraseu&t=$tee"); } } ob_flush(); ?> ___________________________________ And finally this is the code for my actual iframe (in iframefile.php): <? $healthy = array("7PLUS7", "7EQUALS7"); $yummy = array("+", "="); $newphraseu = str_replace($healthy, $yummy, $vary); $finally = base64_decode($newphraseu); if ( $tee == "" ) { $thedone = $finally; } else { $thedone = "$finally&t=$tee"; } if ( $vary == "" ) { ?> <center><iframe onload="refreshFrame();" id="myframe" src="/forum" scrolling="no" marginwidth="0" frameborder="0" marginheight="0" vspace="0" hspace="0" style="overflow:invisible; width:100%; display:none"></iframe></center> <? } else { ?> <center><iframe onload="refreshFrame();" id="myframe" src="/forum/<? echo $thedone; ?>" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:invisible; width:100%; display:none"></iframe></center> <? } ?> Sorry for the long read. Again this all works perfect in firefox but with IE and Chrome the iframe keeps reloading a 404 page after showing the requested page briefly. Any and all help is appreciated! Thanks in advance Hello, New to file upload boxes, working in PHP. My code seems to work great in IE, but not in Firefox or Chrome. This form shows the input box for the filename in IE and Firefox (with a Browse button), but Chrome only shows the Browse button, no filename box. <form enctype="multipart/form-data" method="post" action="profile.php"> <input type="file" size="32" name="image_field_photo" value=""> <br><input type="submit" name="Submit" value="Upload"> IE will upload the file to the specified directory, then update the DB based on the filename. Firefox will not upload the file, nor will Chrome. Using SSL for all pages. Using an upload class I got off PHPClasses.org - what's weird is I have used this same class on another project, and can upload files via Chrome. Any ideas? Thanks! Hi Guys.... I need to export data into excel file. So far its works on IE and Firefox. But if i using Google Chrome it download only php file. Eg(suppose file test.xls but it goes to test.php). Why it happen?? Ok, so I have a REALLY strange problem. So I am trying to delete an array of checkboxes with an input delete piece and I have used a bit of a tutorial on the deletion part. But, my form works fine in IE9 when I do this and doesn't work in firefox when I have it inside a <form> tag. Code: [Select] <form name="deletecheckbox" method="post" action=""> <input name="delete" class="delete_button" type="submit" id="delete" value="Delete" /> //some checkboxes pulled in dynamically thru ajax inside a loop and I won't put the whole looping code just what the checkbox looks like <input name=\"checkbox[]\" type=\"checkbox\" id=\"checkbox[]\" value=\"$ID\"> <? $contact_query = "SELECT ID FROM Contacts ORDER BY ID ASC"; $contact_query_result = mysql_query($contact_query); $count=mysql_num_rows($contact_query_result); if($delete){ for($i=0;$i<$count;$i++){ $del_id = $checkbox[$i]; $sql = "DELETE FROM Contacts WHERE ID='$del_id'"; $result = mysql_query($sql); } } ?> </form> Now, if I do the same thing without the form part, it works in Firefox but not in IE Code: [Select] <input name="delete" class="delete_button" type="submit" id="delete" value="Delete" /> //some checkboxes pulled in dynamically thru ajax inside a loop and I won't put the whole looping code just what the checkbox looks like <input name=\"checkbox[]\" type=\"checkbox\" id=\"checkbox[]\" value=\"$ID\"> <? $contact_query = "SELECT ID FROM Contacts ORDER BY ID ASC"; $contact_query_result = mysql_query($contact_query); $count=mysql_num_rows($contact_query_result); if($delete){ for($i=0;$i<$count;$i++){ $del_id = $checkbox[$i]; $sql = "DELETE FROM Contacts WHERE ID='$del_id'"; $result = mysql_query($sql); } } ?> Anyone know what's goin on here? I'm lost. Code: [Select] <img src=theproblem.gif><br><br> <IMG SRC="qut.gif" BORDER=0> <a href='problem.php?problem_id=81'> <b>Test Test Test Test Test Test Test Test Test</b></a> <IMG SRC="qut.gif" BORDER=0><br> <form action="problem.php?problem_id=81" METHOD="POST"> <input type="image" src="bluestar.jpg" name="client_rate" value="1" alt="1"/> <input type="image" src="blackstar.jpg" name="client_rate" value="2" alt="2"/> <input type="image" src="blackstar.jpg" name="client_rate" value="3" alt="3"/> <input type="image" src="blackstar.jpg" name="client_rate" value="4" alt="4"/> <input type="image" src="blackstar.jpg" name="client_rate" value="5" alt="5"/><br> <EM>1</EM> </form> IE doesn't submit This form but firefox does. What is the problem and how can I fix it? Hi All! First post here - I'm a bit of a self taught PHP junkie I'm having some issues with the following php/MySQL code. The issue is with Internet Explorer (surprise, surprise) I have setup an if statement so that the long description field in the form comes up as a text area (based on the max-length property of the mySQL field.), while the shorter fields come up as text fields. The issue is that in IE, none of the shorter fields preceding the Long Description Text Field show up - ie. the form is lacking a couple of necessary fields. Works perfectly well in Firefox. <form id="addprod" name="addprod" action="" method="get" enctype="multipart/form-data"> <?php require_once($_SERVER['DOCUMENT_ROOT'].'/resources/db/viewer_connect.php'); $table = 'products'; $fieldQuery = "SELECT * from $table"; $result = mysql_db_query($dbname,$fieldQuery) or die('<span class="body_text">Query Error: '.mysql_error().'</span>'); $i = 0; $prInfo = array('PROD_ID'=>'Product ID', 'PROD_NAME'=>'Product Name', 'PROD_DESC_SHORT'=>'Product Description (Short)', 'PROD_DESC_LONG'=>'Product Description (Long)', 'MODEL_1'=>'Model 1', 'MODEL_2'=>'Model 2', 'MODEL_3'=>'Model 3', 'MODEL_4'=>'Model 4', 'MODEL_5'=>'Model 5', 'RRP_1'=>'Model 1 RRP($)', 'RRP_2'=>'Model 2 RRP($)', 'RRP_3'=>'Model 3 RRP($)', 'RRP_4'=>'Model 4 RRP($)', 'RRP_5'=>'Model 5 RRP($)', 'PROD_IMG'=>'Main Image', 'IMAGE_2'=>'Image 2', 'IMAGE_3'=>'Image 3'); while ($i < mysql_num_fields($result)) { $meta = mysql_fetch_field($result, $i); if (!$meta) { echo "No information available<br />\n"; } if($meta->max_length<=256){ if($meta->name=='PROD_IMG'||$meta->name=='IMAGE_2'||$meta->name=='IMAGE_3'){ echo '<p class="body_text"><label for="'.$meta->name.'">'.$prInfo[$meta->name].':<input name="'.$meta->name.'" type="file" size="50" maxlength="'.$meta->max_length.'" /></label></p>'; } else{ echo '<p class="body_text"><label for="'.$meta->name.'">'.$prInfo[$meta->name].':<input name="'.$meta->name.'" type="text" size="50" maxlength="'.$meta->max_length.'" /></label></p>'; } } else{ echo '<p class="body_text" style="line-height:150px; vertical-align:top;"><label for="'.$meta->name.'">'.$prInfo[$meta->name].':<textarea name="'.$meta->name.'" cols="50" rows="10" /></p>'; } $i++; } mysql_free_result($result); ?> <p class="body_text"><input type="submit" value="Add New Record" /><input type="reset" value="Clear Form" /></p> </form> Any thoughts would be awesome!! Thanks in advance, Tim Well, my page contains a URL like file.php?userid=1&pass=passwordhashblablabla. I try to open the page on opera, mozilla, safari, google chrome and so browsers and it works fine. I get the message that id/pw match and user has logged in successfully. However, when I go to THE SAME url on IE, i get message that id/pw do not match. URL is still the same, history is cleaned... Thanks in advance. Hello... I'm working on a webpage (http://66.119.8.164/freedownloads.php) that pulls from an rss feed (http://www.moorelife.org/rss/FreeDownloads.xml). Please keep in mind that I'm working on content, not design. It's a very long page, currently. I want to have links on a sidebar that will allow sorting and filtering, based on <category>. I got the idea from, get this, Internet Explorer's built-in rss reader. It's great. I have a section of the page populating with SimpleXMLElement (that's where the case cover images and titles are). Above that is an alphabetic listing of all those entries populated by SimpleDOM's sortedXPath. Between those two are a few category links that use ajax to overwrite the section pulled with SimpleXMLElement. Now, I don't have any idea if I'm even doing this in an intelligent manner. As a matter of fact, I'm sure it's very far away from resourceful code. It's just what I have gotten to work when other options didn't work. Now, on to the problem. The code, below, is the php file (http://66.119.8.164/include/getrss.php) that ajax uses to overwrite the original list. Code: [Select] <?php //get the category from URL $category = $_GET["category"]; $xml = "http://www.moorelife.org/rss/FreeDownloads.xml"; $xmlDoc = new DOMDocument(); $xmlDoc->load($xml); $item = $xmlDoc->getElementsByTagName('item'); for ($i=0; $i<=5; $i++) { $item_title = $item->item($i)->getElementsByTagName('title')->item(0)->childNodes->item(0)->nodeValue; $item_category = $item->item($i)->getElementsByTagName('category')->item(0)->childNodes->item(0)->nodeValue; echo "<p>".$item_title."</p>"; echo "<p>".$item_category."</p>"; } ?> How do I only show the entries where $catagory match <category>? JJ Hi, as usual there is a problem ONLY with one browser... IE (any version). Please check the webpage & notice the space between the Header buttons. I can't find the PROBLEM!!! Please help!! Thanks in advance.. This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=318213.0 Hi, I have a problem with Internet Explorer converting spaces into underscores: The problem occurs using PHPRtfLite. When I run the script I want the file name to contain spaces, however in Internet Explorer these spaces are converted into underscores. This does not happen in ff, chrome, safari or opera. Any help on how to fix this would be much appreciated as I am stuck. Thanks. Joe p.s. Here is how the file name is created $filename = "Mysite - ".$u-ID."' (".$user_name.").rtf"; Hello everyone, I'm new here first post, but there's a weirdness in code that i need to share, First of all, I know everyone who knows PHP/MYSQL will say the same thing... Server side code cannot be broken by a browser, especially by client side coding. I agree!!! That may be the case here too, but I have encountered one of the weirdest code ever and the client side code is causing an unexpected result in PHP/MYSQL, and only in Internet Explorer. Unexplainable, and I am seeking for an answer. After hours of trouble shooting I finally targeted the the trouble code... and it's CSS, and it's affecting a MYSQL line of code in PHP... #somediv { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=''); } ... anyways let me explain how the code should run and the problem... in one page a variable passed in the URL is being captured by PHP using the $_GET method, if that variable is empty PHP runs a code which updates a MYSQL database. That works fine, and as expected, except in INTERNET EXPLORER. On that same page, a css file which is to be included with the output html to the browser contains the above line of css too. Now in every other browser that code works as expected, if the variable is NOT empty, update the database and then output the html code. In IE the database gets updated no matter what, whether the variable is empty of not. Now the its only the mysql code inside the IF statement that get affected, because for troubleshooting purposes I have put echo statements inside the code, to catch the problem, and the echo statements work as should, just not the mysql update statement. Someone care to shed some light into this mystery? Like many parents, I'm challenged with keeping my kids from browsing the evil parts of the internet. My son is 11 and my wife caught him deleting IE history the other day. The computer he uses is a Windows 8.1 laptop, and it is not Pro. How can i let him use internet explorer on his own user but keep him from tampering with any of the history ( or settings for that matter)? Is there a better solution? I found some internet history logging software online, but I didn't feel comfortable with the source, and fear it may contain viruses or other malware. Hello, I made a website, with 3 lang on it, and site works fine (localhost) but when I upload it, default lang is EN and whenever I change lang on the web, let's say from EN to FR, page goes on that lang in this case on FR and redirect me on home page and all text on site is on FR, that's ok, but after that, when I try to click on let's say about us, then on it's own change it back to default lang, and show me that page (about us) but on default lang... Here is sample of code how it's look... This is select.php and I include_once this file on every page... <?php session_start(); header('Cache-control: private'); // IE 6 FIX if(isSet($_GET['lang'])) { $lang = $_GET['lang']; // register the session and set the cookie $_SESSION['lang'] = $lang; setcookie("lang", $lang, time() + (3600 * 24 * 30)); } else if(isSet($_SESSION['lang'])) { $lang = $_SESSION['lang']; } else if(isSet($_COOKIE['lang'])) { $lang = $_COOKIE['lang']; } else { $lang = 'en'; } switch ($lang) { case 'en': $lang_file = 'lang.en.php'; break; case 'fr': $lang_file = 'lang.fr.php'; break; case 'de': $lang_file = 'lang.de.php'; break; default: $lang_file = 'lang.en.php'; } include_once 'lang/'.$lang_file; This is lang.en.php... $lang = array(); // menu $lang['txt1'] = 'Home'; $lang['txt2'] = 'About Us'; $lang['txt3'] = 'Services'; $lang['txt4'] = 'Contact'; It's the same for other two languages... and I simply put in index.php this... <ul> <li><a href="index.php"><em><b><?php echo $lang['txt1'];?></b></em></a></li> <li><a href="about.php"><em><b><?php echo $lang['txt2'];?></b></em></a></li> <li><a href="services.php"><em><b><?php echo $lang['txt3'];?></b></em></a></li> <li><a href="contact.php"><em><b><?php echo $lang['txt4'];?></b></em></a></li> </ul> Let's say again, this kind of code works fine on localhost, but on web not... Any idea why? Thank you. Cheers. FOR the CMS go to http://sandeepthapa.com.np/project/admin and login in username: user pasword: 123456 with both Chrome and IE. pleease and site is http://sandeepthapa.com.np/project/ it works fine with Chrome, but not with IE. please help me this is my first CMS . i am learning.. it i use joommla templetefor design. oz i am not a designer //..here is the code for process_login.php page <?php require_once("includes/session.php"); ?><?php require_once("includes/connection.php"); ?><?php require_once("includes/functions.php"); ?><?php if (logged_in()) { redirect_to("content.php"); } if (isset($_POST['submit'])) { if(!$_POST['username']) { echo ' Make sure u type in username'; } if( !$_POST['password']) { echo 'make sure you type password'; } $username = trim(mysql_prep($_POST['username'])); $password = trim(mysql_prep($_POST['password'])); $hashed_password = sha1($password); // Check database to see if username and the hashed password exist there. $query = "SELECT id, username "; $query .= "FROM users "; $query .= "WHERE username = '{$username}' "; //$query .= "AND hashed_password = '{$hashed_password}' "; $query .= "AND hashed_password = '{$hashed_password}' "; $query .= "LIMIT 1"; $result_set = mysql_query($query) or die(mysql_error()); if(!$result_set) {die("Database connection failed: " . mysql_error());} confirm_query($result_set); if (mysql_num_rows($result_set) == 1) { // username/password authenticated // and only 1 match $found_user = mysql_fetch_array($result_set); //echo $found_user['id']; $_SESSION['user_id'] = $found_user['id']; $_SESSION['username'] = $found_user['username']; //echo 'test query'; redirect_to("content.php"); } } else { echo 'error'.mysql_error(); } ?> </body> </html> Hi guys, I need a help to find out what is a problem. Some of my code does not work on my local comp and in the same time it works well when I place it on Internet server. First example: Code: [Select] <body> <?php if($_POST['submit_form'] == "Submit") { $varNewTeam = $_POST['Reg_Team']; $varNewCity = $_POST['Reg_City']; $db = mysql_connect('localhost', 'root', '') or die ('no connection with server'); mysql_select_db('db_m ,$db) or die('DB error'); mysql_query ("INSERT INTO reg2012 VALUES ('$varNewTeam','$varNewCity')") or die('insert error'); } ?> <form action="registration_2012_form.php" method="post"> <p>Team: <input type="text" name="Reg_Team" size="20" maxlength="50" value="<?=$varNewTeam;?>" /><br /></p> <p>City: <input type="text" name="Reg_City" size="20" maxlength="50" value="<?=$varNewCity;?>" /><br /></p> <p><input type="Submit" value="Submit" name="submit_form" /></p> </form> </body> On local comp: It gives me message "Undefined index: submit_form". On Net server works well. If I split the code in two files. In the first one I leave the form with "action=FILE2.php" and put my php code in the second file "FILE2.php" - it starts work even on local server. second example: Code: [Select] <body> <?php $db = mysql_connect('localhost', 'root', '') or die ('no connection with server'); mysql_select_db('db_m' ,$db) or die('DB error'); mysql_query ("CREATE TABLE temp1 (team char(50), city char(50) )") or die('create tables error'); ?> </body> It works in the Net and can not create the TABLE on my local comp. I use XAMPP on my local comp (if it's important) |