| | |
Posting data behind the scene
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
1
#2 22 Days Ago
You can use AJAX to post form data. Take a look at this link http://www.captain.at/howto-ajax-form-post-request.php
Failure is not fatal, but failure to change might be. - John Wooden
-1
#3 22 Days Ago
0
#4 22 Days Ago
•
•
•
•
Hi,
index.php posts data to process.php
I want users to remain in index.php when they summit their form. I have seen this in some websites but don't know hot it done.
Can anyone help me?
Thanks
html Syntax (Toggle Plain Text)
<form action="index.php" method="post" > <!-- your form inputs here --> <input type="submit" name="submit" value="Submit" /> </form>
and at the top of your index.php before the header should look something like
php Syntax (Toggle Plain Text)
<?php if(isset($_POST['submit'])) { // do stuff here } ?> // continue to display what was intended for the visitors first visit to the page if submit was not detected.
hope that helps
@ I'm gonna live forever, or die trying.
@ A wise man once told me, in order to understand recursion, you first must understand recursion.
@ A wise man once told me, in order to understand recursion, you first must understand recursion.
0
#5 22 Days Ago
This wont be a solution what he is looking... he wants index.php to submit data to process.php
n btw even if u submit the data to same page, the page gets refreshed which can be avoided only by asynchronous data transfer possible through AJAX.
n btw even if u submit the data to same page, the page gets refreshed which can be avoided only by asynchronous data transfer possible through AJAX.
•
•
•
•
All you need to do is submit the page to itself from the form tag. you will also need to make sure you give your submit button a name attribute. For example.
html Syntax (Toggle Plain Text)
<form action="index.php" method="post" > <!-- your form inputs here --> <input type="submit" name="submit" value="Submit" /> </form>
and at the top of your index.php before the header should look something like
php Syntax (Toggle Plain Text)
<?php if(isset($_POST['submit'])) { // do stuff here } ?> // continue to display what was intended for the visitors first visit to the page if submit was not detected.
hope that helps
0
#6 22 Days Ago
Apologies you are correct, I misread the original post.
@ I'm gonna live forever, or die trying.
@ A wise man once told me, in order to understand recursion, you first must understand recursion.
@ A wise man once told me, in order to understand recursion, you first must understand recursion.
0
#10 20 Days Ago
sure this will do the trick but i dont feel its a healthy practice as the user will get a window flashed in front n then disappearing....
Also, after closing the process file, how will u update the values in original index.php without refreshing it... I agree u will submit the form but u need to show a success or error message to user regarding it...
so best way to achieve this(AFAIK) is AJAX
Also, after closing the process file, how will u update the values in original index.php without refreshing it... I agree u will submit the form but u need to show a success or error message to user regarding it...
so best way to achieve this(AFAIK) is AJAX
Gimme reputation points if u find my post helpful.
use [code] tags wherever applicable
dont start a new thread unless u cant find the topic already on forum.
mark a thread "solved" as soon as u get a solution
use [code] tags wherever applicable
dont start a new thread unless u cant find the topic already on forum.
mark a thread "solved" as soon as u get a solution
![]() |
Similar Threads
- Posting data from x to y to be processed ? (PHP)
- POSTing data to web page (Python)
- Autmating posting data to a php-based website (PHP)
- Button to send POST data (JavaScript / DHTML / AJAX)
- Simple question: Popup page to post data to mother page (PHP)
- JavaScript posting data (JavaScript / DHTML / AJAX)
- Data Extraction (Visual Basic 4 / 5 / 6)
- posting data from a form to msg broker fail (RSS, Web Services and SOAP)
- Challenging Problem in PASSing Data to Server, Plz Help (ASP)
Other Threads in the PHP Forum
- Previous Thread: Returns only 1 record from mysql database..:(
- Next Thread: how to write regular expression in PHP?
| Thread Tools | Search this Thread |
# 5.2.10 action address apache api array auto autoincrement beginner binary broken cakephp checkbox class classes cms code cron curl database date dehasher destroy display dissertation domain dynamic echo echo$_get[x]changingitintovariable... email error errorlog fatalerror file files folder form forms function functions google href htaccess html if-else image images include insert ip javascript joomla legislation limit link load login mail masterthesis menu mlm multiple mysql mysqlquery oop open paypal pdf persist php popup problem query radio random record recursion remote script search server sessions sms sockets source space sql syntax system table tutorial update upload url validator variable video web youtube






