Is this impossible with my script?????????( Very need help)

Discussion in 'PHP' started by junandya, Nov 10, 2007.

  1. #1
    Hello php masters,

    i have a trouble in a variable with my script. please see to this script:

    File core.php

    <TABLE>
    <TR>
    <TD colspan="2">
    <A href='Login.php?idPage=<?PHP echo $theId; ?>'>Login</A>
    </TD>
    </TR>
    <TR>
    <TD></TD>
    <TD><?PHP include "begin.php"; ?></TD>
    </TR>
    </TABLE>
    PHP:
    File begin.php

    <?PHP
    $theId = "begin.php?sc=user&hal=1";
    ?>
    PHP:
    the idea is, i want to give an id to this page (core.php), so after user loged in, they will be sent back to this page again. The key of this page is in begin.php file. Because there are some many files that can be included like begin.php file. so those other files will have a $theId on itself.

    The problem is the $theId is declared in begin.php file,.... and this file is included in the second <TR> to the core.php which will send that $theId value on the first <TR>. If you ask me why is that, it is because the website design/layout.

    Does someone here can help me with this problem. how to send the $theId value so i can use it on the 4th line of core.php file.

    I hope all of you understand with what i'm explaining here,

    Thanx B4
     
    junandya, Nov 10, 2007 IP
  2. Awesome Ninja

    Awesome Ninja Peon

    Messages:
    141
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I had no idea really what you were trying to say but try this;

    
    <TABLE>
    <TR>
    <TD colspan="2">
    <A href='Login.php?idPage=<?PHP include "begin.php"; echo $theId; ?>'>Login</A>
    </TD>
    </TR>
    <TR>
    <TD></TD>
    <TD></TD>
    </TR>
    </TABLE>
    
    PHP:
     
    Awesome Ninja, Nov 10, 2007 IP
  3. junandya

    junandya Member

    Messages:
    79
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #3
    i mean,....if i reduce the script after including, i hope you understand what i mean:

    <?PHP
    echo $theId;
    $theId = "begin.php?sc=user&hal=1";
    ?>
    PHP:
    the echo will show nothing, because the $theId not yet declared.

    your answer is not possible, because if i have a rest script on begin.php, teh website design/layout will mussy.

    i hope you understand...
     
    junandya, Nov 10, 2007 IP
  4. junandya

    junandya Member

    Messages:
    79
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #4
    i hope nico_swd could help me.........
     
    junandya, Nov 10, 2007 IP
  5. bobb1589

    bobb1589 Peon

    Messages:
    289
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #5
    i am really confused by what you mean... i suggest trying to use sessions maybe?
     
    bobb1589, Nov 10, 2007 IP