Jump to content

NoamChomsky

New Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by NoamChomsky

  1. Thanks - that worked. I can't lie about this - I don't know PHP at all well at this stage. I'm a front-end guy prototyping an interface that will then be made to work by a backend guy. Which is why my code was so ridiculous. I didn't know you could check if what you're trying to GET is set in that way, in researching an answer I read up on something that was more complicated than it needed to be. Cheers for the help, much appreciated!
  2. Hi all - I'm trying to echo $_GET something from the URL, and display a short message to the user if the echo $_GET fails - but I'm new to PHP and the code I've whipped up doesn't work. It always displays the message even if the information is present in the url and the $_GET should work. Here's the code I've got: <h3> <?php $qset = strpos($_SERVER['SCRIPT_NAME'], 'qtitle'); if ($qset === false) { echo "You haven't added any questions yet."; } else { echo $_GET['qtitle']; } ?> </h3> The URL will contain "qtitle=(something)" if they've filled out a form on the prior page. Can someone tell me what I'm doing wrong? I have a feeling I've overcomplicated things... Thanks again!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.