PHP issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • barcodes
    Confirmed User
    • Mar 2011
    • 2040

    #1

    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
    Registered User
    • Dec 2010
    • 85

    #2
    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.

    Comment

    • barcodes
      Confirmed User
      • Mar 2011
      • 2040

      #3
      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.

      Comment

      • robber
        Web Developer
        • Jan 2011
        • 264

        #4
        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

        Comment

        Working...