GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   help passing php variables (https://gfy.com/showthread.php?t=256742)

yoyo2 03-22-2004 06:32 PM

help passing php variables
 
I need help in trying to pass php variables from page to page, so that I know how my different advertising campaigns are doing?? Im new to php and don't know how to do this...thanks

StuartD 03-22-2004 06:33 PM

www.php.net :thumbsup

BadBrad 03-22-2004 06:51 PM

Do you mind passing these via the URL or is this something you don't want shown?

JamesDotCom 03-22-2004 06:52 PM

Not sure exactly what you are trying to achieve but it may be something like this. You have many different pages pointing one place and want to see where the hits are coming from? If so, this example might give you a rough idea.

Many pages:

<a href="http://this.is.my/single/page.php?referrer=here">Link 1</a>

<a href="http://this.is.my/single/page.php?referrer=there">Link 1</a>


The one page:

<pre>
&lt;?php
if ($_GET["referrer"])
{
echo "Referrer: ".$_GET["referrer"];
}
else
{
echo "Came without a referral";
}
?>
</pre>
Normally from within the if statement you would store the value in a database etc for future reference. Let me know if you need anymore help.

:thumbsup

yoyo2 03-22-2004 08:38 PM

I actually want to pass them through the url...Here is what im trying to do: I have say 3 different advertisements pages (one.html?yahoo one.html?tgp one.html?linklist) and all of them will be advertising the same site..i just want to know how to pass on these variables through the sites tour until they hit the signup button? thanks guys

AvanteGuard 03-22-2004 09:05 PM

here's what i would do....

To get this:

tour1.php?from=yahoo
tour2.php?from=yahoo
tour3.php?from=yahoo

on the forms do this:

<a href='tour2.php?from=$from'>Next</a>
<a href='tour3.php?from=$from'>Next</a>
<a href='signup.php?from=$from'>Signup</a>

**EDIT**
PHP Code:

<a href='tour2.php?from=$from'>Next</a>
<
a href='tour3.php?from=$from'>Next</a>
<
a href='signup.php?from=$from'>Signup</a

**/EDIT**

Or at least that's what I would do...you could try playing with cookies, but I wouldn't recommend it (but you could do it if you were trying to hide the "from=yahoo" part.

Let me know if that works for you!

slackologist 03-22-2004 09:11 PM

What JamesDotCom said. There are other ways but that is nice and easy.

rickholio 03-22-2004 09:17 PM

Another option is to make use of sessions, which is specifically designed to track persistant data across requests to the same site (you didn't specify if the data had to be passed across multiple domains, or just different pages on the same domain)

http://www.php.net/manual/en/ref.session.php

should get you pointed in the right direction.

yoyo2 03-22-2004 09:42 PM

I will need it for both...alot of my tgp galls will be on a different server than my paysite. So I will need to track this variable from my tgp.html?one over to my paysite and then through the tour pages to my signup page...just looking for something simple that works good. Do i need to change my php.ini? or do i just add this php code in my pages? thanks again

Ash@phpFX 03-23-2004 01:25 AM

can someone clue me in on how to do

xxx.html?something

rather than xxx.html?var=something


ive seen it used a lot but never used it myself.

thanks in advance :thumbsup

yoyo2 03-23-2004 01:34 PM

bump......would also like to know how to do this: index.html?yahoo


thanks again


All times are GMT -7. The time now is 01:28 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123