PHP - Submit Form On Same Page With Get Url
hi i hv a form to submit on this url
http://localhost/site/index.php?action=search and in my html <form method="GET" action="<?php echo $_SERVER['PHP_SELF'];?>" name="searchForm"> // my code </form> // i also tried //http://localhost/site/index.php?action=search& // but did not helped now problem is i wants to go that URL so after submit it should look a like this as i am loading search page with action. http://localhost/site/index.php?action=search&searchstring=word but it keeps me redirecting to http://localhost/site/index.php?searchstring=word how can i make it work so it will goto this URL http://localhost/site/index.php?action=search&searchstring=word Thanks for help. Similar TutorialsI have the website he http://bossexclusive.com/babyauction/index.php , and http://bossexclusive.com/babyauction/thanks.php . When you press submit on the index.php, it takes you to thanks.php. then, after 5s, it takes you back to index.php. My question is: How could I make it so when I press submit, the box submits the form, but instead of redirecting to thanks.php, it displays the same thank you message on the side, but stays on index.php? If that didn't make sense, let me know. My html and php are below (HTML) 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>Baby Auction | Discounted Premium Brand Baby Products</title> <link rel="stylesheet" type="text/css" href="styles.css"/> </head> <body> <div id="main"> <div id="contact"> <h1>Sign up to recieve Auction notifications</h1> <form action="emailer.php" method="post"> <input type="text" name="email" id="email" placeholder="yourname@email.com" /> <input type="image" name="submit" src="images/submit.jpg" width="146px" height="20px" value="Submit"> </form> </div> </div> <div class="copyright"> <?php include 'footer.php'; ?> </div> </body> </html> and emailer.php: Code: [Select] <?php $email = trim(strip_tags($_POST['email'])); $subject = "Contact form submitted!"; $to = 'BlankingOutMyEmail@gmail.com'; $body = <<<HTML $message HTML; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; mail($to, $subject, $body, $headers); header('Location: thanks.php'); ?> I have two pages. one is insert_events.php and the other is veiw_events. In insert_events i have a form which have a submit button. I want when i click on the submit button, it redirects me to the view_events.php page showing the events. Any idea about this problem will be appreciated. Thanks Hi All, Is there any way that PHP can detect if a page has been refreshed? Basically I have a form that when submitted, inserts a row in to a database, but I am finding that when I refresh the page, it repeats the insert statement. Any ideas? Thanks Matt Alright, so I play a browser game called Politics and War. I run an alliance that has 74 members. In that alliance we offer a bank service for all our members, but I - being the leader - am the only one who can access the bank. I have been building a site that works with the game API to gather data for members and create a dashboard. One of the features I am trying to build is allowing them to withdraw from their account instantly.
So, what I need: To be able to submit a POST request to login to the site (specifically on this page --> https://politicsandwar.com/login) with my username and password, but then I need to keep the session active and navigate to a different page (the alliance bank page). On that page I first need to scrape a value from a hidden input (token) and then I need to submit a POST request to this same page while still being logged in.
I am not asking someone to do it for me, but rather someone to help me know how to go about this. I have never submitted post requests with PHP, but I have used PHP cURL in the past. I also have made POST requests with JS, but never PHP.
Thank you so much for anyone that is able to help! I have two pages one is db.php and another is form.php. In form.php i have created a form which contains different fields and a submit button. But i want to write the queries in db.php. And when i click on the submit button the insert query in db.php should be executed and insert data in database but the focus remains on form.php. How can i do this??? Any Idea? Hi Guys, I am fairly new to PHP, and I recently changed my whole site to use PHP sessions, which worked fine. Then I added PHP parts in my pages that display different menu choices depending on if a PHP session exists. This also works fine, until I found that any HTML/PHP pages that have form/submits no longer work, and I get kicked back to the index.php After slow backtracking, I removed new parts, and found the forms started working again if I removed the PHP part that chooses which JavaScript file to reference, as follows from contact.php <?php if (isset($_SESSION['SESS_MEMBER_ID'])){ echo "<script language=\"JavaScript\" type=\"text/javascript\" src=\"menu_horz.js\"></script>"; } else {echo "<script language=\"JavaScript\" type=\"text/javascript\" src=\"log_menu_horz.js\"></script>"; } ?> I tried changing the echo ".." to use single quotes ' ' instead, but then it doesn't work at all then with a form or no form on the page. I assume I am doing something wrong, but I can't find any resources that give me a definitive way of referencing Javascript files. What freaked me out was only the ones with forms were an issue. I am using <?php session_start(); ?> at the beginning of every page (before any output). Other PHP code on the page is working fine. Only the above part seems to be the problem, and works too, as long as I don't submit a form. - Could it be more weirder :-) - I tried also to find a workaround, but it would mean having PHP inside my JavaScript file, but I am not sure it would work, since JS is client side, and PHP server... Essentially, I just want to run certain JS menus depending if the person is logged in or not. - Example contact.php attached Any ideas of what the problem might be with the code above? Will be grateful for any help you can give. Regards D Hi everyone, as the title stated, I would like to know how I could submit a form in one page(cart) and unset a session variable on other page.
Right now my form is setting a variable within the page back to 0, however I would like the form to unset the session variable from other page as well.
The issue with my code is that every time I attempt to clear out all items, my code can empty out the cart. But whenever I close and reopen the cart, the same content will show up again. So I need to unset the session variable.
Please let me know what should I do in order to solve the problem and I greatly appreciate your help.
My code is currently looking like this:
cart.php
if(!empty($_GET['aID'])) { $aID = $_GET['aID']; echo $aID; if(isset($_POST['removeAll'])) { $aID = "0"; } $cartSQL = "SELECT * from article where aID in ($aID)"; echo "cart sql :$cartSQL"; $cartQuery = mysqli_query($dbc, $cartSQL) or die (mysqli_error($dbc)); while($row = mysqli_fetch_array($cartQuery, MYSQLI_BOTH)) { $aTitle[] = $row[ 'name' ]; } } <form action = "" method = "POST"> <td style = "width = 200px"><input type="submit" value="Empty cart" name="removeAll"></td> </form>And this is the session variable from other page where I would like it to be unset upon submitting the form. if(!empty($cartSubmit)) $_SESSION["cartSubmit"] = $cartSubmit; else $cart = $_SESSION["cartSubmit"]; <a href="javascript:popup('cart.php?aID=<?php if(empty($cartSubmit)) echo "$cart"; else echo "$cartSubmit";?>')">Cart</a> I am creating a user inbox system. I am retrieving all the unread messages. Each message row contains a "reply" form. So say I have 10 messages showing on a single page. That's 10 forms. What I would like to know is how can I submit any one of the 10 forms and not have it affect the remaining 9 forms? Here is the basic code. if(isset($_POST['submit'])) { $post_message = trim($_POST['message']); $errors = array(); $db->beginTransaction(); if(empty($post_message)) { $errors[] = 'The message field can not be empty!'; } if(empty($errors)) { $db->commit(); echo 'success'; } else { $db->rollBack(); } } <form action="" method="post"> <fieldset> <textarea name="message" maxlength="10000" placeholder="What would you like to say?"></textarea> </fieldset> <fieldset> <input type="submit" name="submit" value="Submit" /> </fieldset> </form>
Say I have an "Entries" table. I want to submit same multiple entries using a form submission. And If I have other queries submitted in the same form, I want those quarries to be submitted only once. Is that possible to do? Here's my code. if(isset($_POST['submit'])) { $entries = 10; $id = 55; $name = 'Smith'; $insert = $db->prepare("INSERT INTO entries(id, name) VALUES(:id, :name)"); $insert->bindParam(':id', $id); $insert->bindParam(':name', $name); $result_insert = $insert->execute(); if($result_insert == false) { echo 'Fail'; } else { echo 'Success'; } } ?> <form action="" method="post"> <input type="submit" name="submit" value="SUBMIT" /> </form> Edited January 13, 2019 by imgrooot Hi. Pretty straight forward I guess but as the name suggests am a newbie. I have a form that requires the user to enter certain parameters. If the values are blank it submits to itself and loads the error messages. What I want to do is create PHP code that submits the form to a different url. What I thought was create two forms (the second with hidden fields replicating the first form), each form having a different url in the action"" code. What I cant work out is the PHP IF ELSE code to submit form 2 if Form1 is is validated correctly. This is the PHP code relevant to the form validation. Help? <?php //If form was submitted if ($_POST['submitted']==1) { $errormsg = ""; //Initialize errors if ($_POST[width]){ $title = $_POST[width]; //If title was entered } else{ $errormsg = "Please enter width"; } if ($_POST[drop]){ $textentry = $_POST[drop]; //If comment was entered } else{ if ($errormsg){ //If there is already an error, add next error $errormsg = $errormsg . " & content"; }else{ $errormsg = "Please enter drop"; } } } if ($errormsg){ //If any errors display them echo "<div class=\"box red\">$errormsg</div>"; } //If all fields present if ($title && $textentry){ //Do something echo 'THIS IS WHERE I WANT THE CODE TO SUBMIT FORM 2 or SUBMIT FORM 1 TO A DIFFERENT URL'; } ?> Hello. I hope one of the PHP/HTML gurus here can help me. I have a web page that has been altered a bit to add some Google Analytics stuff and I've moved it to a 2nd directory. The original one works fine, the 2nd one won't post the form when I click the submit button. 1st URL https://www.theneutralizer.info/neutralizer 2nd URL: https://www.theneutralizer.info/neutralizer2 I have changed the action property to the correct script, and it does exist. But the problem is when clicking the button nothing happens. Anyone have any ideas? I can send the PHP code if needed, but since it's HTML output, it should work the way it is displayed in the browser. David Hello, first time poster.. I've looked the web over for a long time and can't figure this one out. - Below is basic code that successfully checks MySQL for a match and displays result. I was debugging and forced the "height" and "width" to be 24 and 36 to make sure that wasn't the problem. That's good.. - I'd like to give the user ability to select width and height from a form.. and have it do an onchange this.form.submit so the form can be changing as fields are altered (thus the onchange interaction) - In a normal coding environment I've done this numerous times with no "Page cannot be displayed" problems. It would simply change one select-option value at a time til they get down the form and click submit... but in WordPress I'm having trouble making even ONE single onchange work! - I've implemented the plugins they offer which allows you to "copy+paste" your php code directly into their wysiwyg editor. That works with basic tests like my first bullet point above. - I've copied and pasted the wordpress url (including the little ?page_id=123) into the form "action" url... that didn't work... tried forcing it into an <option value=""> tag.. didn't work. I'm just not sure. I've obviously put xx's in place of private info.. Why does this form give me Page Cannot Be Displayed in WordPress every time? It won't do anything no matter how simple.. using onchange.. Code.. $con = mysql_connect("xxxx.xxxxxxx.com","xxxxxx","xxxxx"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("xxxxxx", $con); $myprodwidth=24; $myprodheight=36; $result = mysql_query("SELECT * FROM product_sizes WHERE prodwidth='$myprodwidth' and prodheight='$myprodheight'"); while($row = mysql_fetch_array($result)) { echo $row['prodprice']; } mysql_close($con); <form method="post" action=""> <select name="myheight" onchange="this.form.submit();"> <option selected="selected" value="">select height</option> <option value="xxxxxxxxx.com/wordpress/?page_id=199&height=36">36</option> <option value="xxxxxxxxx.com/wordpress/?page_id=199&height=36">48</option> </select> Hi all, What I am trying to achieve is, I thought quite simple! Basically, a user signs up and chooses a package, form is submitted, details added to the database, email sent to customer, then I want to direct them to a paypal payment screen, this is where I am having issues! Is their any way in php to submit a form without user interaction? Here is my code for the form process page Code: [Select] <?php include('config.php'); require('scripts/class.phpmailer.php'); $package = $_POST['select1']; $name = $_POST['name']; $email = $_POST['email']; $password = md5($_POST['password']); $domain = $_POST['domain']; $a_username = $_POST['a_username']; $a_password = $_POST['a_password']; $query=mysql_query("INSERT INTO orders (package, name, email, password, domain, a_username, a_password) VALUES ('$package', '$name', '$email', '$password', '$domain', '$a_username', '$a_password')"); if (!$query) { echo "fail<br>"; echo mysql_error(); } else { $id = mysql_insert_id(); $query1=mysql_query("INSERT INTO customers (id, name, email, password) values ('$id', '$name', '$email', '$password')"); if (!$query1) { echo "fail<br>"; echo mysql_error(); } if($package=="Reseller Hosting") { //email stuff here - all works - just cutting it to keep the code short if(!$mail->Send()) { echo "Message could not be sent. <p>"; echo "Mailer Error: " . $mail->ErrorInfo; exit; } ?> <form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick-subscriptions"> <input type="hidden" name="business" value="subscription@jollyhosting.com"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="item_name" value="Jolly Hosting Reseller Packages"> <input type="hidden" name="no_shipping" value="1"> <!--1st month --> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="a3" value="3.00"> <input type="hidden" name="p3" value="1"> <input type="hidden" name="t3" value="M"> <input type="hidden" name="src" value="1"> <input type="hidden" name="sra" value="1"> </form>'; <?php } //last } //end ?> Hi- the code below lets me upload a CSV file to my database if I have 1 field in my database and 1 column in my CSV. I need to add to my db "player_id" from the CVS file and "event_name" and "event_type" from the form... any ideas??? here's the code: Code: [Select] <?php $hoststring =""; $database = ""; $username = ""; $password = ""; $makeconnection = mysql_pconnect($hoststring, $username, $password); ?> <?php ob_start(); mysql_select_db($database, $makeconnection); $sql_get_players=" SELECT * FROM tabel ORDER BY player_id ASC"; // $get_players = mysql_query($sql_get_players, $makeconnection) or die(mysql_error()); $row_get_players = mysql_fetch_assoc($get_players); // $message = null; $allowed_extensions = array('csv'); $upload_path = '.'; //same directory if (!empty($_FILES['file'])) { if ($_FILES['file']['error'] == 0) { // check extension $file = explode(".", $_FILES['file']['name']); $extension = array_pop($file); if (in_array($extension, $allowed_extensions)) { if (move_uploaded_file($_FILES['file']['tmp_name'], $upload_path.'/'.$_FILES['file']['name'])) { if (($handle = fopen($upload_path.'/'.$_FILES['file']['name'], "r")) !== false) { $keys = array(); $out = array(); $insert = array(); $line = 1; while (($row = fgetcsv($handle, 0, ',', '"')) !== FALSE) { foreach($row as $key => $value) { if ($line === 1) { $keys[$key] = $value; } else { $out[$line][$key] = $value; } } $line++; } fclose($handle); if (!empty($keys) && !empty($out)) { $db = new PDO( 'mysql:host=host;dbname=db', 'user', 'pw'); $db->exec("SET CHARACTER SET utf8"); foreach($out as $key => $value) { $sql = "INSERT INTO `table` (`"; $sql .= implode("`player_id`", $keys); $sql .= "`) VALUES ("; $sql .= implode(", ", array_fill(0, count($keys), "?")); $sql .= ")"; $statement = $db->prepare($sql); $statement->execute($value); } $message = '<span>File has been uploaded successfully</span>'; } } } } else { $message = '<span>Only .csv file format is allowed</span>'; } } else { $message = '<span>There was a problem with your file</span>'; } } ob_flush();?> <!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>CSV File Upload</title> </head> <body> <form class="form" action="" method="post" enctype="multipart/form-data"> <h3>Select Your File</h3> <p><?php echo $message; ?></p> <input type="file" name="file" id="file" size="30" /> <br/> <label>Event Name:</label><input name="event_name" type="text" value="" /> <br/> <label>Event Type:</label><input name="event_type" type="text" value="" /> <br/> <input type="submit" id="btn" class="button" value="Submit" /> </form> <br/> <h3>Results:</h3> <?php do { ?> <p><?php echo $row_get_players['player_id'];?></p> <?php } while ($row_get_players = mysql_fetch_assoc($get_players)); ?> </body> </html> How I am wondering how to add a redirect to a form with multiple buttons. All should redirect to same page Hello i have a form on my page which submits on the same page but sometimes when i press submit and the page reloads the header padding comes out on the page so its actually split from the top of the screen and when its loaded it goes back, i have both margin and padding set to 0 for the body and header so dont know why this is happening, can someone help me out with this? Hi there. When i press the submit button it shows me the blank page. Do u have any idea why? (i tried also to show me errors but it doesnt show even errors, although the display erorr works well) I want to send the user inputs and chosens to the database: (table form contains all the fields required (type, price, picture, gear,condition...etc)) here is the html page: Code: [Select] [m]<body> <div id="wrapper" class="container_12 clearfix"> <!-- Text Logo --> <h1 id="logo" class="grid_4"></h1> <!-- Navigation Menu --> <ul id="navigation" class="grid_8"> <li><a href="contact.php"><span class="meta">Get in touch</span><br />Contact Us</a></li> <li><a href="blog.php"><span class="meta">Latest news</span><br />Blog</a></li> <li><a href="portfolio.php"><span class="meta">Our latest work</span><br />Portfolio</a></li> <li><a href="about.php" class="current"><span class="meta">Who are we?</span><br />About</a></li> <li><a href="index.php"><span class="meta">Homepage</span><br />Home</a></li> </ul> <div class="hr grid_12 clearfix"> </div> <!-- Caption Line --> <h2 class="grid_12 caption">Complete the <span>Admin Form</span> </h2> <div class="hr grid_12 clearfix"> </div> <div> <div class="grid_12 caption"> <form action="adminFormSubmit.php" method="get" enctype="multipart/form-data" name="adminForm"> <table width="100%" border="0" align="center"> <tr> <th scope="row"><div align="right">Type</div></th> <td><div align="center"> <input type="text" name="type" id="type" /> </div></td> </tr> <tr> <th scope="row"><div align="right">Year</div></th> <td><div align="center"> <input type="text" name="year" id="year" /> </div></td> </tr> <tr> <th scope="row"><div align="right">Gear</div></th> <td><div align="center"> <select name="gear" id="gear"> <option value="M">Manual</option> <option value="A" selected="selected">Automatic</option> </select> </div></td> </tr> <tr> <th scope="row"><div align="right">Condition</div></th> <td><div align="center"> <select name="condition" id="condition"> <option value="N" selected="selected">New</option> <option value="U">Used</option> </select> </div></td> </tr> <tr> <th scope="row"><div align="right">Km's Past</div></th> <td><div align="center"> <input type="text" name="km" id="km" /> </div></td> </tr> <tr> <th scope="row"><div align="right">Price</div></th> <td><div align="center"> <input type="text" name="price" id="price" /> </div></td> </tr> <tr> <th scope="row"><div align="right">Picture</div></th> <td><div align="center"> <input type="file" name="picture" id="picture" /> </div></td> </tr> <tr> <th scope="row"> </th> <td><div align="center"> <input class="button" type="submit" name="adminFormSubmit" id="adminFormSubmit" value="Submit" /> </div></td> </tr> <tr> <th scope="row"><div align="right"></div></th> <td><p align="right"><a class="button" href="logout.php">Log out</a></p></td> </tr> </table> </form> </div> </div> <div class="hr grid_12 clearfix"> </div> <!-- Footer --> <p class="grid_12 footer clearfix"> <span class="float"><b>EpokaUniversity || All Rights Reserved © Copyright</b> || HarisKrasniqi, DiamantNeziri, HarisMemeti, KelmendTairi.</span> <a class="float right button" href="#">top</a> </p> </div><!--end wrapper--> </body>[/m] and here is the php code: Code: [Select] [m]<?php //check if the button is pressed if(isset($_POST['adminFormSubmit'])){ //Connect to database require_once('Connections/ecommerce_dbcon.php'); // Check to see if the type of file uploaded is a valid image type function is_valid_type($file) { // This is an array that holds all the valid image MIME types $valid_types = array("image/jpg", "image/jpeg", "image/bmp", "image/gif", "image/png"); if (in_array($file['type'], $valid_types)) return 1; return 0; } // This variable is the path to the image folder where all the images are going to be stored // Note that there is a trailing forward slash $TARGET_PATH = "adminform_images/"; // Get our POSTed variables $type = $_POST['type']; $year = $_POST['year']; $gear = $_POST['gear']; $condition = $_POST['condition']; $km = $_POST['km']; $price = $_POST['price']; $picture = $_FILES['picture']; // Sanitize our inputs $type = mysql_real_escape_string($type); $year = mysql_real_escape_string($year); $gear = mysql_real_escape_string($gear); $condition = mysql_real_escape_string($condition); $km = mysql_real_escape_string($km); $price = mysql_real_escape_string($price); $picture['name'] = mysql_real_escape_string($picture['name']); // Build our target path full string. This is where the file will be moved do // i.e. images/picture.jpg $TARGET_PATH .= $picture['name']; // Make sure all the fields from the form have inputs if ( $type == "" || $year == "" || $gear == "" || $condition == "" || $km == "" || $price == ""|| $picture['name'] == "" ) { echo "Te gjithe fushat duhet plotesuar. <a href=adminsection.php>Provo perseri</a>"; exit; } // Check to make sure that our file is actually an image // You check the file type instead of the extension because the extension can easily be faked if (!is_valid_type($picture)) { echo "Fotografite duhet te jene te formateve jpg, jpeg, bmp, gif, ose png. <a href=adminsection.php>Kthehu prapa</a>"; exit; } // Here we check to see if a file with that name already exists // You could get past filename problems by appending a timestamp to the filename and then continuing if (file_exists($TARGET_PATH)) { echo "Ju lutem nderroni emrin e fotos dhe provoni perseri. <a href=adminsection.php>Kthehu prapa</a>"; exit; } // Lets attempt to move the file from its temporary directory to its new home if (move_uploaded_file($picture['tmp_name'], $TARGET_PATH)) { // NOTE: This is where a lot of people make mistakes. // We are *not* putting the image into the database; we are putting a reference to the file's location on the server $sql = "INSERT INTO form (type, year, gear, condition, km, price, picture, date_added,) values ('$type', '$year', '$gear', '$condition', '$km', '$price', '" . $image['name'] . "', now(),)"; $result = mysql_query($sql) or die ("Futja e te dhenave ne databaze DESHTOI. <a href=adminsection.php>Provo perseri</a> "); echo "Shtimi i te dhenave u krye me SUKSES. Klikoni per te shkuar tek <a href=index.php>faqja kryesore</a>"; exit; } else { // A common cause of file moving failures is because of bad permissions on the directory attempting to be written to // Make sure you chmod the directory to be writeable echo "Shtimi i te dhenave NUK u krye me Sukses. Ju lutem provoni <a href=adminsection.php>perseri</a>"; exit; } } ?>[/m] Hello, Im new to website building. I have created a login system. The login system echoes some text when the username and password is correct. However, if correct i would like it to open another page on my site. Code: [Select] <form name="form1" method="post" action=""> <p>Username <label> <input type="text" name="username" id="username"> </label> Password <label> <input type="password" name="password" id="password"> </label> <input name="login" type="submit" id="login" value="Login"> <?php $username = $_POST ["username"]; $password = $_POST ["password"]; if ($username == "admin" && $password == "password"){ echo"Logged In";} ?> </p> </form> I am a novice and learnt this via youtube. However, can't find a tutorial for what i want. Thanks Hi, I want to submit a form using ajax ans jquery with two fields input text and file. Code: [Select] <script> $(document).ready( function() { $('#basicinfofrm').ajaxForm(function() { url: ''+PN+'.php', type:'POST', data:'action=yes&'+frmFeilds, success: function(html) { alert(html); } }).submit(); </script> <form action='' method='post'> <label>name</label> <input type='text' name='txtname' /> <input type='file' name = 'txtfile' /> <input type='submit' value='save' /> </form> but is is not working... can anyone tell me how to? i don't want to refresh my page Thanks Hi, I have setup a basic enquiry form with a Captcha - once the code has been inserted and is correct I want to action the form (submit) in PHP. <?php session_start(); if($_SERVER['REQUEST_METHOD'] == 'POST'){ $vResult = ''; if(strtolower($_SESSION['security_code']) != strtolower($_POST['security_code'])){ $vResult = 'Invalid code!'; } else{ "/enquiry.php" } } ?> I want to submit the form to /enquiry.php - I tried header(Location.. and realised that just redirects, and doesn't submit the form. Any suggestions or tips would be great. Cheers, Paul |