Jump to content

processing and displaying data


rpjd

Recommended Posts

I have page1.php which has a post form and page2.php which display data/results.  I have a seperate php script file which queries a database.  Having completed the query and assuming a result, I would end up with something like

while($result = mysql_fetch_assoc($query))

how do I get the data onto the display page.  Looking at example approaches I found this using a go-between file

<?PHP 
include_once(process.php;
process($_POST);
display_results; 
?>

would display_results be a form of redirect?  If not?

Any help appreciated.

Link to comment
Share on other sites

Your form is going to post to it's target, and that script will have the values from the form in the $_POST.  Assuming you need to use the post in your query, your results script should just contain or include the query.  There is no redirect or intermediary involved.

Link to comment
Share on other sites

I don't mind doing the data processing on the same page as the display page, but I don't want the servername, user and password visible?  Can/should I have the connection details listed in another security file perhaps?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.