how do i send values from a server side PHP script to my curent web page
I want to pass back to the web page that called my server sode script - i want to pass back values and these values need to set the propertys in the current web page that uses HTML and is a iframe construct?
Re: how do i send values from a server side PHP script to my curent web page
I do not know ajax so if you can explain to me how it can be done to pass varaibles back from the server side script do i use ajax on teh server sode script or is that on the client side the ajax is used - if it is on the client side i still need to know how i should pass the varables back from teh server side php script.
Re: how do i send values from a server side PHP script to my curent web page
we have the $_POST(something); then what in the server side PHP script us used to stuff the varaiables I want to pass to the client web page so that the $_POST(something); will contain somekind of value in my case will be a text string and will be a file name and maybe or maybe not a path with it.
For example on the server side PHP script the following: I have astablished needs this at least but what else just add what you think to my example.
Here is my problem - I do not want to use a $_GET because i feel it is unsafe from Hackers - So I would like to use something else like maybe a $_POST here os part of what I have figured out so far in my server side script PHP at the bottom after getting data from lets say a MYSQL database
header("Location:"index-7.php ");
// - I want to Pass some value to the
// client which is my index-7.php using
// a $_POST if that is teh best to use but
// how do i send it with //expecting to sue a
// submit button in a form which is the only way
// up to //this point have i seen how to do
// it - but I do not have a form on my
// server side script and i want to send the data
// back with having the //user do anything. BUT
// THE QUESTION WHAT TO USE TO DO IT - and
// what would the code or script look like to do
// it - PLEASE GIVE ME //EXAMPLE HERE?
Re: how do i send values from a server side PHP script to my curent web page
PLease tell me if this server side script will work and do what i want it to do does anyone have a better way without useing a $_GET becaise i do not trust the usei of passing varables through the url its self - address in teh browser.
<?
/* make the "action" of the form go to that form */
// THIS STARTS THE WORK HERE
if(sizeof($_POST)) {
$body = "";
while(list($key, $val) = each($HTTP_POST_VARS)) {
if ($key != "submit")
$body .= "$key: $val \n";
}
echo $body;
echo "<br><br>";
echo "Parseing results from Lodges history web page";
unset($index);
switch($body){
case "lodgapage1":
$index="johntheard.php" ;
break;
case "lodgapage1":
$index="essex.php";
break;
default:
$index="index.php";
}
echo $index;
echo "<br><br>";
echo "Parsed get lodges histroy";
echo "This is the name of the lodge History :" . $index; // The name of the lodge
echo "<br>";
header("Location:"index-7.php ");
echo $index;
exit;
// echo "<META HTTP-EQUIV=\"Refresh\"
// CONTENT=\"0; URL=index-7.php\">";
}
// end form processing
?>
Re: how do i send values from a server side PHP script to my curent web page
I found a cool sulution to the problem i think
The onload will exectuve the submit which in turn will send the form variables to the index-7.php. You will want to put all of the form processing, etc in the index-7.php. you will also want to put echo statement in index-7.php to reflect any logic, etc that will be sent back to the client.