PHP pages passing parameters everywhere...

Discussion in 'Web Design and Development' started by bigandy, Apr 21, 2007.

  1. bigandy macrumors G3

    bigandy

    Joined:
    Apr 30, 2004
    Location:
    Murka
    #1
    I can't figure out why everytime i run an action on this fracking website (like adding a favourite to a certain table), it insists on redirecting to the location i want, but it keeps sending the parameters everywhere, like

    favourites.php?action=add&item=thatone

    even if i get it to go to frack.php, it still sends the question mark and the bits after.

    anyone got a quick idea how to stop PHP from forwarding these parameters after running a script?

    yeah, i admit it, i'm doing it in Dreamweaver. it's redirect code is

    PHP:
    $insertGoTo "/favourites/";
    and

    PHP:
    header(sprintf("Location: %s"$insertGoTo));
     
  2. Mal macrumors 603

    Mal

    Joined:
    Jan 6, 2002
    Location:
    Orlando
    #2
    The problem is that you're using a GET function instead of a POST function. If you switch the code to POST, it won't show the parameters in the URL.

    The bigger problem though seems to be that you don't know PHP. It's not something you can usually just let Dreamweaver do for you. I'd recommend going to php.net and looking over some of their tutorials, or the other tutorials sites listed in the thread at the top of this forum.

    jW
     
  3. bigandy thread starter macrumors G3

    bigandy

    Joined:
    Apr 30, 2004
    Location:
    Murka
    #3
    I knew it was something this simple, as I've learnt and done it before.

    I also feel a little insulted by your 'assumption' that I don't know PHP, after I illustrated a minor problem, wishing a quick hand with it.

    Assumptions is something people shouldn't really make on minor questions like this, as they can often end up completely in the wrong. What if, for example, the person you're 'assuming' at just forgot? What if, the OP suffers from short term memory loss, which makes remembering smaller parts of PHP bloody difficult?

    I'm sorry if this insults you, but 'helpfully pointing out' that someone doesn't know something is not the place of people on this forum. It's all about helping each other.

    [/rant]

    And just to make it clear - thanks for pointing out the solution to my issue.
     
  4. Mal macrumors 603

    Mal

    Joined:
    Jan 6, 2002
    Location:
    Orlando
    #4
    :rolleyes: Right, because your original post didn't indicate that you didn't know PHP at all. :rolleyes:

    Dude, sorry if you really do know more than your post made it sound, but you kinda implied that you were just letting Dreamweaver do all the coding, which is generally a very bad idea.

    jW
     

Share This Page