GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Webmaster Q & Fuckin' A (https://gfy.com/forumdisplay.php?f=27)
-   -   PHP issue (https://gfy.com/showthread.php?t=1021206)

barcodes 05-04-2011 05:06 PM

PHP issue
 
Hey again everyone.

I am hoping someone can help me figure this out.
I want to make a variable that i can rename manually per page.
I then want to change the url to go here i need it to go based on that variable.
Im more of a coldfusion guy and could do this easily, but I am restricted to doing this with php.

Here is an example of what I would do in CF incase I am unclear above:

Code:

Set the Var in the header file
<cfparam name="location" default="home">

Create the link (going to do this with url feeds, but for simplicity ill use an image)
<cfoutput><img src="#location#.jpg"></cfoutput>

Change the tag in, lets say, contact page:
<cfset location="contact" />

Right now in my ghetto way of thinking, I am making an if else with rss urls in php and trying to find a way to call them from each page.

Thanks in advance for any help =D

Sexgenoten 05-05-2011 02:41 PM

Im not entirely sure that i understand what you are trying to achieve here.

You could set an hidden input on each page, so a post to the php page would make it clear from what page its comming in $_POST['var'].

You could put a get var in de url ( either www.mysite.com/index.php?var or something similair ).

Only thing you then have to do is filter the desired var and assign its value to a variable in PHP.

From there you can you do your php magic.

barcodes 05-05-2011 09:07 PM

U know....

After looking at this post again and reading yours, I realize that I am trying to do too much. It doesn't need to be pulled the way I was trying to do it.

Thanks for your help, I really appreciate it.

robber 05-07-2011 06:57 AM

All you need it to use:

<?php $_GET['var']; ?>

This would get the variable from the url so index.php?var=123 would mean the variable returned would have the value of 123

message me if you are unsure

Rob


All times are GMT -7. The time now is 05:23 PM.

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