PHP - Php Form Action Works In Firefox But Not Chrome
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"> Similar TutorialsI 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';?> 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! 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 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?? 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 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. 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> This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=346255.0 <?PHP include("include/session.php"); ?> <html> <head> <title></title> <style type="text/css"> .auto-style1 { text-align: center; } .auto-style2 { border: 2px solid #3366FF; } .auto-style3 { font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif; } </style> </head> <body style="background-color: #AAC6FF"> <?PHP if(isset($_SESSION['useredit'])){ unset($_SESSION['useredit']); echo "<h1><center>User Account Edit Success!</center></h1>"; echo "<p><b><center>$session->username</b>, your account has been successfully updated. " ."<a href=\"javascript:window.close();\">Close Window</a>.</p></center>"; }else{ ?> <?PHP if($session->logged_in){ ?> <h1 class="auto-style1"><span class="auto-style3">User Account Edit :</span> <? echo $session->username; ?></h1> <?PHP if($form->num_errors > 0){ echo "<td><font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font></td>"; } ?> <form action="process.php" method="POST"> <div align="center"> <table class="auto-style2" style="width: 300px"> <tr> <td>Current Password:</td> <td> <input name="curpass" style="width: 150px" type="password" value="<? echo $form->value("curpass"); ?>"></td> <td><? echo $form->error("curpass"); ?></td> </tr> <tr> <td>New Password:</td> <td> <input name="newpass" style="width: 150px" type="password" value="<? echo $form->value("newpass"); ?>"></td> <td><? echo $form->error("newpass"); ?></td> </tr> <tr> <td>Current Email:</td> <td><input name="email" style="width: 150px" type="text" value="<? if($form->value("email") == ""){ echo $session->userinfo['email']; }else{ echo $form->value("email"); } ?>"></td> <td><? echo $form->error("email"); ?></td> </tr> <tr> <td> </td> <td> <form method="post"> <input type="hidden" name="subedit" value="1"> <input name="submit" type="submit" value="submit"></form> </td> </tr> </table> </div> </form> <?PHP } } ?> </body> </html> When I click the save changes button, I want the user to be brought back to profile.php. Right now they are being brought to editprofile.php. I currently have the form action set to editprofile.php . When the I change it to profile.php my fields won't update. Any thoughts as to where I went wrong? Here is the editprofile.php code. <form action='editprofile.php' method="POST" id="form"> This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=351832.0 how do I put a get id into this form, or use $myvar?: Code: [Select] <form action='read2.php?id=' method="post" name='myForm' id="myForm"></form> Im having some problems with my PHP program... Im trying to get the imformation send to my inbox, but when i push the submit button; i get no email and the "thank you message" is incomplete.. (see attachement: thankUmessage.png) I have to say, im not really a PHPfreak , I understand this language a little.. I hope someone can help me first the codes: HTML: (see attachement: form.png) Code: [Select] <!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>contactformulier</title> <style type="text/css"> <!-- body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 13px; color: #FFFF00; } body { background-color: #CCCCCC; } .style2 {font-size: 16px} --> </style> <script type="text/javascript"> <!-- function MM_validateForm() { //v4.0 if (document.getElementById){ var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments; for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]); if (val) { nm=val.name; if ((val=val.value)!="") { if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@'); if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n'; } else if (test!='R') { num = parseFloat(val); if (isNaN(val)) errors+='- '+nm+' must contain a number.\n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n'; } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; } } if (errors) alert('The following error(s) occurred:\n'+errors); document.MM_returnValue = (errors == ''); } } //--> </script> </head> <body> <form id="form1" name="form1" method="post" action="contactafhandeling.php"> <table width="400" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" bgcolor="#000000"> <!--DWLayoutTable--> <tr> <td height="39" colspan="6"><div align="center" class="style2">Contact formulier<br /> </div></td> </tr> <tr> <td height="21"><div align="right">Aanhef:</div></td> <td width="4" rowspan="7"> </td> <td colspan="4" valign="top"> <select name="aanhef" id="aanhef"> <option value="dhr" selected="selected">Dhr.</option> <option value="mvr">Mvr.</option> </select> </td> </tr> <tr> <td width="72" height="20"><div align="right">Voorletters:</div></td> <td width="42" valign="top"><div align="left"> <input name="voorletters" type="text" id="voorletters" size="5" maxlength="40" /> </div></td> <td width="120" valign="top"><div align="center">Achternaam: </div></td> <td colspan="2" valign="top"><div align="left"> <input name="achternaam" type="text" id="achternaam" size="20" maxlength="40" /> </div> <div align="left"></div> </td> </tr> <tr> <td height="20"><div align="right">Adres:</div></td> <td colspan="2" valign="top"><div align="left"> <input name="adres" type="text" id="adres" size="20" maxlength="40" /> </div> <div align="center"></div> <div align="left"></div></td> <td width="79" valign="top"><div align="center">Postcode:</div></td> <td valign="top"><div align="right"> <input name="postcode" type="text" id="postcode" size="10" maxlength="7" /> </div></td> </tr> <tr> <td height="20"><div align="right">Woonplaats:</div></td> <td colspan="4" align="right" valign="top"><div align="left"> <input name="woonplaats" type="text" id="woonplaats" size="20" maxlength="40" /> </div> <div align="left"></div> <div align="left"></div> <div align="left"></div></td> </tr> <tr> <td height="20"><div align="right">Tel:</div></td> <td colspan="4" valign="top"><div align="left"> <input name="tel" type="text" id="tel" size="20" maxlength="10" /> </div></td> </tr> <tr> <td height="20"><div align="right">Email:</div></td> <td colspan="4" valign="top"> <div align="left"> <input name="email" type="text" id="email" size="40" maxlength="40" /> </div></td> </tr> <tr> <td height="20"><div align="right">Interesses:</div></td> <td colspan="4" valign="top"><div align="left"> <label></label> <label> <input type="checkbox" name="badkamer" id="badkamer" /> Badkamermeubels</label> <label> <br /> <input type="checkbox" name="kantoor" id="kantoor" /> Kantoormeubels</label> <label> <br /> <input type="checkbox" name="kasten" id="kasten" /> Kasten</label> <label><br /> <input type="checkbox" name="keukens" id="keukens" /> Keukens <br /> </label> <label> <input type="checkbox" name="tafels" id="tafels" /> Tafels</label> <br /> </div></td> </tr> <tr> <td height="21" colspan="5" valign="top"><input type="reset" name="reset" id="reset" value="Reset" /></td> <td width="83" height="21" valign="top"><input name="verzenden" type="submit" id="verzenden" onclick="MM_validateForm('voorletters','','R','achternaam','','R','tel','','RisNum','email','','RisEmail');return document.MM_returnValue" value="Verzenden" /></td> </tr> </table> </form> </body> </html> Looks like: afbeelding 1.png Then the PHP code: Code: [Select] <!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>Contactafhandeling</title> </head><body> <? $aanhef = $_POST['aanhef']['dhr']; $aanhef = $_POST['aanhef']['mvr']; $voorletters = $_POST['voorletters']; $achterNaam = $_POST['achterNaam']; $adres = $_POST['adres']; $postcode = $_POST['postcode']; $tel = $_POST['tel']; $email = $_POST[email]; $interesses = $_POST['badkamer']['kantoor']['kasten']['keukens']['tafels']; $formsent = mail('sven_jcvd@hotmail.com', 'Gegevens afkomstig van contactformulier.html', "Naam: $aanhef $voorletters $achterNaam\r\n Adres: $adres\r\n Postcode: $plaatst\r\n Telefoonnummer: $tel\r\n Emailadres: $email\r\n Interesse in: $interesses", "From: $email\r\nBounce-to: sven_jcvd@hotmail.com"); if ($formsent) { echo "<p>Beste $achternaam,<br><br> Bedankt voor uw bericht, we zullen zo snel mogelijk contact met u opnemen.\n\r Met vriendelijke groet, JPS</p>"; } else { echo "<p>Sorry, er gaat iets fout met het formulier, probeer het later nog eens a.u.b.</p>"; } ?> </body> </html> I've heard multiple recommendations when a form needs to post to itself. Some say use PHP_SELF, others say leave it blank (even though it doesn't validate), etc. Please provide the best practice, and reasons why. Thank you
echo("<form method='post' action='{$_SERVER['PHP_SELF']}'>"); echo("<form method='post' action=''>"); This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=316303.0 Hi there, I was wondering if it was possible to change a forms action field with PHP. Basically, if there are several checkboxes for the user to select and a specific checkbox was selected, how would I redirect users to an alternative webpage on submit? I've been playing around with several methods, and one of them was: Code: [Select] <?php if(isset($_POST['Example']) && $_POST['Example'] == 'FormValueGoesHere') { echo ('./page1.php'); } else { echo ('./page2.php'); } ?> But the form action would only display page1.php even with nothing selected. Maybe I'm just being stupid because it's getting late, but I'd appreciate any assistance. Thanks How do you have an HTML form process a function for an action? I tried what I have below, but i just can't get it to work right. Any ideas? Thanks for your help. For example: Code: [Select] <?php function UserLookup(){ $searchfield = $_POST['searchfield']; $client = new SoapClient("http://www.domain.com/webservice.asmx?WSDL"); $result = $client->UserLookup(array('searchfield'=>$searchfield)); echo json_encode($result); } if (isset($_GET['submit'])) { UserLookup(); } else { ?> <form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>" > <input name="searchfield" type="text" size="45" /> <input type="submit" value=" Search " /> </form> <?php } ?> is there anyway to hide the action URL from html form example: <form name="afrom" action="hide.php" method="post"> so it end up from the user side: <form name="afrom" action="" method="post"> Thanks! |