how to pass variable from one page to another
Started on the old forum in October 2012 · view the original in the archive · old links redirect here
Var1 change to what variables you need
$variable_page1 = $_GET['var1'];
Clean your var
isset($_GET['var'])?$var=mysql_escape_string($_GET['var']):$var='SomeDefaualtValue';
Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!
SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…
subzero wrote: Var1 change to what variables you need
$variable_page1 = $_GET['var1'];Clean your var
isset($_GET['var'])?$var=mysql_escape_string($_GET['var']):$var='SomeDefaualtValue';
thank you for quick reply but i am unable and this is not what i asked,
as per i said like i am getting the referer in get.php but i need to insert that value in DB from click.php when i am getting a real click after checking this, so need to pass the $referer without any form or using url to get function....
Other words,
You want to pick up more then 1 file
file1 file2
both submit same values ?
if you trying to by pass a click to a toplist or any type from other server with out clicking does not work..
Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!
SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…
there are many ways 🙂 it depends on how you get from page one to page two. Via link? or do you use redirection? ... the best way would be with sessions 🙂 or cookies.... or you can make it a lot easier and move the code from click.php to get.php 🙂 as I said... it depends...
or you can use the POST method... via a form and a button 🙂
jaidon20k wrote: Lol use header("location: link-to-go.php");
lol did u read what i wanted to know?
i would make a form. that was made to LOOK like a link. then use the input hidden to pass the data from 1 page to another.
css to make form/button look like link
.button-link
{
background: none;
border: 0;
color: #65ACCA; /** #87CEEB */
text-decoration: none;
font-size: 100%;
}
.button-link:hover
{
background: none;
border: 0;
color: #65ACCA; /** #87CEEB */
font-weight: normal;
font-size: 100%;
}
.button-link:visited
{
color: #800080; /** Purple */
text-decoration: none;
}
.button-link:active
{
color: #FF0000; /** Red */
text-decoration: none;
}
then the form
echo '<form action="TO-PHP-FILE.php" method="post">';
echo '<input type="hidden" name="referer" value="http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'"/>';
echo '<input class="button-link" type="submit" name="submit" value="Lets Submit The Data"/>';
echo '</form>';
Then On File To Recieve Data.
if(!empty($_POST['submit']))
{
$referer = $_POST['referer'];
}
i use this method to make my buttons looks like links. then pass/create the new data.
hmm. poop. i guess i didnt read properly. you dont want to use a form. whats wrong with using the include(); function to include the file with the data to the file in question?
Ghost wrote: i would make a form. that was made to LOOK like a link. then use the input hidden to pass the data from 1 page to another.
css to make form/button look like link
.button-link { background: none; border: 0; color: #65ACCA; /** #87CEEB */ text-decoration: none; font-size: 100%; } .button-link:hover { background: none; border: 0; color: #65ACCA; /** #87CEEB */ font-weight: normal; font-size: 100%; } .button-link:visited { color: #800080; /** Purple */ text-decoration: none; } .button-link:active { color: #FF0000; /** Red */ text-decoration: none; }then the form
echo '<form action="TO-PHP-FILE.php" method="post">'; echo '<input type="hidden" name="referer" value="http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'"/>'; echo '<input class="button-link" type="submit" name="submit" value="Lets Submit The Data"/>'; echo '</form>';Then On File To Recieve Data.
if(!empty($_POST['submit'])) { $referer = $_POST['referer']; }i use this method to make my buttons looks like links. then pass/create the new data.
hmm. poop. i guess i didnt read properly. you dont want to use a form. whats wrong with using the include(); function to include the file with the data to the file in question?
ghost sir your idea is very good and i also think it ago but i cannot do that as it is a advertisement system and publishers will request the page get.php from their site with our ad code so this thing can not be set there, anyway thanks for suggession
razor wrote: how to pass variable from one page to another page without the use of form or url. e.g: i have a variable
$referer= 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];in get.php file and i need to pass the $referer value to click.php , then how to do it?
It would be much better if you post the code... Anyway you can define constant var or if it is in function in click.php define $referer global:
function something() {
global $referer;
// The rest of code...
}
Or just make it $GLOBALS['referer'] and use it where you want.
arnage wrote: It would be much better if you post the code... Anyway you can define constant var or if it is in function in click.php define $referer global:
function something() { global $referer; // The rest of code... }
this would of been my next suggestion. just make it a function. global $referer; that would do it.
was expecting a reason for the include function to not be used. but i guess there wasnt one lol.
p.s sorry for late replying. had to go shops etc. needed to get me my smokes for the night.
If you dont want the world to change that value of the variable while transporting, then
//ads.php
session_start();
$_SESSION['ref'] = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
//Do something
//click.php
session_start();
$ref = $_SESSION['ref'] // value was set in ads.php
//Do something
session_destroy();
NOTE that, session still needs cookies to be enabled in end user's browser, else you need to pass the constant SID in URL
I need some facebook likes, can you please help me 🤝 http://facebook.com/softwarefreakin I noticed social media is really powerful 🧙 Well DONE is better than well SAID
To use the @import rule, type:
<style type="text/css">
@import url("import1.css");
@import url "import2.css";
</style>
The url() is not required. The double quotes are required for valid XHTML, but browsers that support url() tend to support it with or without quotes.
You can also include an @import rule in a style sheet with styles:
<style type="text/css">
@import url("import3.css");
p { color : #f00; }
</style>
Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!
SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…
softwarefreak wrote: If you dont want the world to change that value of the variable while transporting, then
//ads.php session_start(); $_SESSION['ref'] = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; //Do something//click.php session_start(); $ref = $_SESSION['ref'] // value was set in ads.php //Do something session_destroy();NOTE that, session still needs cookies to be enabled in end user's browser, else you need to pass the constant SID in URL
World can't change it if its handeled properly. 🙂 And using sessions in this type of script where many people constantly clicks for such a small thing increases a risk of overhead.
arnage wrote: World can't change it if its handeled properly. 🙂 And using sessions in this type of script where many people constantly clicks for such a small thing increases a risk of overhead.
Bro, if get, post, cookies are used, the value can be changed easily by an advanced end user. safe side is session only. but if an algorithm is used to encode the data instead of just base64 encoding/decoding, thats ok I guess 🤝
I need some facebook likes, can you please help me 🤝 http://facebook.com/softwarefreakin I noticed social media is really powerful 🧙 Well DONE is better than well SAID