php, links not working.

Results 1 to 17 of 17
  1. #1
    Account Upgraded | Title Enabled! shortymant is offline
    MemberRank
    Nov 2008 Join Date
    606Posts

    php, links not working.

    opened up my site, heres the php code to the link:

    Code:
     <a href="index.php?do=downloads">Downloads</a>
    i got a file named downloads.php in the same folder,
    hit the link Download, and it dosent go.


  2. #2
    Account Upgraded | Title Enabled! Kreain is offline
    MemberRank
    May 2008 Join Date
    679Posts

    Re: php, links not working.

    your meant to code the ?do part, its not just leaving the file there, its fairly easy using array's, look it up

  3. #3
    Account Upgraded | Title Enabled! shortymant is offline
    MemberRank
    Nov 2008 Join Date
    606Posts

    Re: php, links not working.

    i dont no php all that well.
    soz for bein a noob ;(
    i had this working a while ago, i just didnt know wtf was going on now.

  4. #4
    Account Upgraded | Title Enabled! Kreain is offline
    MemberRank
    May 2008 Join Date
    679Posts

    Re: php, links not working.

    im not sure cant rmbr but i think its

    PHP Code:
    <?php

    $acts 
    = array('downloads');
    $act $_GET['do'];

    if(
    $act == 'downloads'){
    echo 
    "
    <meta http-equiv='REFRESH' content='0;url=http://www.xxxxxxx.com/downloads.php'>
    "
    ;
    };

    ?>

  5. #5
    Account Upgraded | Title Enabled! Kreain is offline
    MemberRank
    May 2008 Join Date
    679Posts

    Re: php, links not working.

    sorry, kinda necro-ing but
    PHP Code:
    <?php

    $act 
    $_GET['do'];
    $acts = array('downloads');

    if(
    $act == 'downloads'){
    echo 
    "
    include './downloads.php';
    "
    ;
    };

    ?>
    is better

  6. #6
    Account Upgraded | Title Enabled! Testing-NLG is offline
    MemberRank
    Dec 2008 Join Date
    NetherlandsLocation
    357Posts

    Re: php, links not working.

    PHP Code:
    <?php

    $act 
    $_GET['do'];
    $down 'downloads';

    if(
    $act == $down){
    include (
    'downloads.php');
    }

    ?>
    anyway that should be better and shorter =]

  7. #7
    Account Upgraded | Title Enabled! Kreain is offline
    MemberRank
    May 2008 Join Date
    679Posts

    Re: php, links not working.

    oh yeah, roflmao ho noob of me, im coding my site now and i was just using an echo so yh xD

  8. #8
    Account Upgraded | Title Enabled! katsumi is offline
    MemberRank
    Oct 2008 Join Date
    Earth ??Location
    592Posts

    Re: php, links not working.

    Quote Originally Posted by shortymant View Post
    opened up my site, heres the php code to the link:

    Code:
     <a href="index.php?do=downloads">Downloads</a>
    i got a file named downloads.php in the same folder,
    hit the link Download, and it dosent go.
    Using Mpog ?
    rename downloads.php to mod_downloads.php

  9. #9
    Account Upgraded | Title Enabled! Testing-NLG is offline
    MemberRank
    Dec 2008 Join Date
    NetherlandsLocation
    357Posts

    Re: php, links not working.

    Quote Originally Posted by Kreain View Post
    oh yeah, roflmao ho noob of me, im coding my site now and i was just using an echo so yh xD
    Np <3
    Quote Originally Posted by katsumi View Post
    Using Mpog ?
    rename downloads.php to mod_downloads.php
    That is possible, since I never downloaded the free sites I dont know that .

  10. #10
    Praise the Sun! Solaire is offline
    MemberRank
    Dec 2007 Join Date
    Undead BurgLocation
    2,862Posts

    Re: php, links not working.

    Quote Originally Posted by Testing-NLG View Post
    PHP Code:
    <?php

    $act 
    $_GET['do'];
    $down 'downloads';

    if(
    $act == $down){
    include (
    'downloads.php');
    }

    ?>
    anyway that should be better and shorter =]
    Actually.

    PHP Code:
    <?php

    if (isset($_GET['do']) && $_GET['do'] == "downloads") {
        include(
    "downloads.php");
    }

    ?>
    I don't use variables at all, which is better. Plus I check if the $_GET is set. It's a requirement in PHP > 6.0 I believe.

  11. #11
    Account Upgraded | Title Enabled! Testing-NLG is offline
    MemberRank
    Dec 2008 Join Date
    NetherlandsLocation
    357Posts

    Re: php, links not working.

    Quote Originally Posted by Wizkidje View Post
    Actually.

    PHP Code:
    <?php

    if (isset($_GET['do']) && $_GET['do'] == "downloads") {
        include(
    "downloads.php");
    }

    ?>
    I don't use variables at all, which is better. Plus I check if the $_GET is set. It's a requirement in PHP > 6.0 I believe.
    You are right,
    anyway I was just editing Kreain his post because he also ended with an
    PHP Code:
     
    after
    PHP Code:


  12. #12
    Account Upgraded | Title Enabled! Kreain is offline
    MemberRank
    May 2008 Join Date
    679Posts

    Re: php, links not working.

    as I said, I was using echo alot at the time lol

  13. #13
    The beer?? Its here !!! Rotana is offline
    MemberRank
    Jan 2007 Join Date
    The NetherlandsLocation
    1,733Posts

    Re: php, links not working.

    Quote Originally Posted by Wizkidje View Post
    Actually.

    PHP Code:
    <?php

    if (isset($_GET['do']) && $_GET['do'] == "downloads") {
        include(
    "downloads.php");
    }

    ?>
    I don't use variables at all, which is better. Plus I check if the $_GET is set. It's a requirement in PHP > 6.0 I believe.
    It also works on php 5 i believe

  14. #14
    Account Upgraded | Title Enabled! Testing-NLG is offline
    MemberRank
    Dec 2008 Join Date
    NetherlandsLocation
    357Posts

    Re: php, links not working.

    Quote Originally Posted by Rotana View Post
    It also works on php 5 i believe
    I thought I saw that somewhere to

  15. #15
    Account Upgraded | Title Enabled! shortymant is offline
    MemberRank
    Nov 2008 Join Date
    606Posts

    Re: php, links not working.

    I honestly don't know what i did, but it now does work with the;
    Code:
      <a href="index.php?do=downloads">Downloads</a>
    Rofl. I hate php so much :P

  16. #16

    Re: php, links not working.

    well in html it be and its the same just like php for creating links.
    <a href="http://www.google.com">Google</a>
    thats just for the link and just get the link of the web you want to access and paste it to the href=blahblah

  17. #17
    Praise the Sun! Solaire is offline
    MemberRank
    Dec 2007 Join Date
    Undead BurgLocation
    2,862Posts

    Re: php, links not working.

    Quote Originally Posted by Rotana View Post
    It also works on php 5 i believe
    It works on PHP3 as well, but PHP 6.0 requires an isset() check over a GET and POST.



Advertisement