Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more

Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Web Programming > PHP Development
User Name
Password

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 06-24-2007, 01:09 AM   #1 (permalink)
Frank Shaw
Junior Member
 
Join Date: Jun 2007
Posts: 14
Default 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?

THANKS

Frank H. Shaw
Frank Shaw is offline   Reply With Quote
Sponsored Links
Old 06-28-2007, 09:57 AM   #2 (permalink)
AdIncent.com
Junior Member
 
Join Date: Jun 2007
Posts: 7
Default Re: how do i send values from a server side PHP script to my curent web page

Did you try to use Ajax ? (prototypejs.org -> very good framework to use AJAX)
I think it will help you very much if know a little bit javascript
AdIncent.com is offline   Reply With Quote
Old 06-28-2007, 03:07 PM   #3 (permalink)
Frank Shaw
Junior Member
 
Join Date: Jun 2007
Posts: 14
Default 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.

THANKS

Frank H. Shaw
Frank Shaw is offline   Reply With Quote
Old 06-29-2007, 09:56 PM   #4 (permalink)
Frank Shaw
Junior Member
 
Join Date: Jun 2007
Posts: 14
Default 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?


exit;
Frank Shaw is offline   Reply With Quote
Old 06-30-2007, 03:30 AM   #5 (permalink)
Frank Shaw
Junior Member
 
Join Date: Jun 2007
Posts: 14
Default 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
?>
Frank Shaw is offline   Reply With Quote
Old 07-04-2007, 12:09 AM   #6 (permalink)
Frank Shaw
Junior Member
 
Join Date: Jun 2007
Posts: 14
Default 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.


<script>

function auto() {

document.myform.submit();

}

</script>


<body onload="auto();">

<form action="index-7.php" method="POST" name="myform">

<input type="hidden" value="somevalue" name="you know">

<input type="hidden" value="somevalue" name="what todo here">

<input type="hidden" value="somevalue" name="so do it">

<input type="hidden" value="somevalue" name="ok">

</form>

Exit:
Frank Shaw is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Points Per Thread View: 1.00
Points Per Thread: 11.00
Points Per Reply: 5.00



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare
Dedicated Servers

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 10:39 PM.



LinkBacks Enabled by vBSEO 3.0.0 RC8
Webmaster Forums