Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End PHP $GET

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #26830
    jonleesmith
    Member

    Hi People i was wondering if anyone could help me,

    I want to get a variable out of the address bar and use it with my database content selection as a hazardous guess i tried

    Code:
    $page = $GET[‘pages’];

    SELECT * FROM database WHERE title=’$page’

    Before anyone says I know this is totally wrong but worth a try!

    Any help would be greatfully appreciated, or someone to point me in the direction

    Thanks In advance

    Jonathan
    jonleesmith.co.uk

    #66812

    It’s $_GET and don’t forget to addslashes() to anything you using a database query.

    Code:
    $page = $_GET[‘pages’];

    SELECT * FROM database WHERE title=’ . addslashes($page) .’

    http://php.net/manual/en/reserved.variables.get.php
    http://uk3.php.net/manual/en/function.addslashes.php

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.