Forum Moderators: coopster
I'm not sure I understand what you are asking here, but I will make one comment based on pure assumption here...
It seems you are wanting to rely on form data to determine whether or not you will update a row in a file. This really isn't good practice as the form value can be compromised quite easily.
If this is a database, I would actually attempt to insert first (assuming the row has primary key/unique definitions) and update on error. Otherwise, run a select statement first to see if the row exists and update accordingly.
Sorry if i was unclear it's the old first I will tell you what I want, now I am going to tell you what I really want.
Basically I would like to have a page opened from with in a php script without the user haveing to do anything.
<?php
.....update a database (this is working fine)
.....open a page mypage.php
?>
Hope this is clearer
ie.
On the input side:
<input type="hidden" name="go" value="yes">
On the output side:
<?php
if ($go == "yes")
{
echo"JAVASCRIPT TO OPEN CONFIRMATION WINDOW GOES HERE";
}
?>
This is just my thought, sorry if it's not what you are looking for...
-- Zak
<? header("Location: newpage.php?reqnum=123");?> Problem with that is people can generate phoney thank you pages so better yet, don't redirect and do this:
<?
...your database code here, then...$reqnum = '12345';
include("thankyou.php");
die;
?>
'Die' is there so the rest of your form page doesn't render. thankyou.php would look something like:
<html><body>
Thank you, you're req number is <?=$renum?>.
</body></html> Hope I made sense. :)