Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Dec 2010
    Location
    Kent, UK
    Posts
    573
    Thanks
    23
    Thanked 10 Times in 10 Posts

    include into page problem

    hi guys, ive got this problem, when i insert a page into my page using the code below:

    PHP Code:
    if ($fetch->armclicks >= "1") {
    include_once(
    "validate.php?page=arm");

    i get the error:

    Code:
    Warning: include_once(validate.php?page=arm) [function.include-once]: failed to open stream: No such file or directory in /home/tacticsc/domains/360-tactics.co.uk/public_html/crimewave/arm.php on line 16
    
    Warning: include_once() [function.include]: Failed opening 'validate.php?page=arm' for inclusion (include_path='.:/usr/local/lib/php') in /home/tacticsc/domains/360-tactics.co.uk/public_html/crimewave/arm.php on line 16
    i believe its something to do with the ?page=arm as when i take this out it works fine :s anyone got any ideas?
    http://360-tactics.co.uk/forum/index.php

    Crime-Wave

    please post your code wrapped in tags
    please post your PHP wrapped in tags

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    You can't include a querystring only a file.

  • #3
    Regular Coder
    Join Date
    Dec 2010
    Location
    Kent, UK
    Posts
    573
    Thanks
    23
    Thanked 10 Times in 10 Posts
    in that include page could i set it to collect what page the user has come from? and do it that way? instead of using a $_GET in the validation page?
    http://360-tactics.co.uk/forum/index.php

    Crime-Wave

    please post your code wrapped in tags
    please post your PHP wrapped in tags

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Quote Originally Posted by Dan13071992 View Post
    in that include page could i set it to collect what page the user has come from? and do it that way? instead of using a $_GET in the validation page?
    GET is superglobal, you can retrieve it in any scope and in any included script.

  • #5
    Regular Coder
    Join Date
    Dec 2010
    Location
    Kent, UK
    Posts
    573
    Thanks
    23
    Thanked 10 Times in 10 Posts
    sorry what i ment is, ive got a piece of code in the validation.php:

    PHP Code:
    $page $_GET['page']; 
    this determines what page the user came from so that when the users validates it places the $page into the database, so my actually correct question should be, instead of using $page = $_GET['page']; however would i find out what page the user has come from?
    http://360-tactics.co.uk/forum/index.php

    Crime-Wave

    please post your code wrapped in tags
    please post your PHP wrapped in tags

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    I don't understand this question at all. HTTP is stateless, you need to be provided with any information of relevance on every request. If you're looking for the referring page, the browser may be requested to provide it from the $_SERVER['HTTP_REFERER']; however, browsers are not required to provide this.
    Aside from this, you must provide these values in either a get, post, cookie or session variable.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •