SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Please help

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Mar 2001
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Please help

    Hi guys, thanks for all the help i got last time

    can one of you php gurus please visit http://www.jellyman.net/index2.php
    and tell me what that error is and how do i fix it


    thx alot

  2. #2
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Somewhere in the code you have:

    eval(....)

    And it looks like you have a parse error in it like using ?php or something. Print out the evaled code and we'll tell you.

  3. #3
    SitePoint Member
    Join Date
    Mar 2001
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok here is the function template($name)

    function template ($name) {
    $query = mysql_query("SELECT * FROM templates WHERE name='$name'") or die(mysql_error());
    $data = mysql_fetch_array($query);

    $template = "<!-- BEGIN TEMPLATE: $name -->\n$data[code]\n<!-- END TEMPLATE: $name -->";
    return $template;
    }

    the eval code which calls the template and what is giving the error is

    eval("\$loginnblock = \"".template('block_login')."\";");

    then the code of the template block_login is

    <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td width="1%" bgcolor="#FFAE35"></td> <td width="98%" bgcolor="#FF9900"><b><font face="Tahoma, Verdana, Arial, Helvetica, sans-serif" size="2"><p align="center">Membership</font></b> </td> <td bgcolor="#FFAE35" width="1%"></td> </tr> <tr bgcolor="#FFFFFF"> <td colspan="3"><form method="POST" action="login.php"><input type="hidden" name="action" value="dologin"> <table width="100%" cellspacing="0" cellpadding="0"> <tr> <td colspan="2"><font face="Tahoma, Verdana, Arial, Helvetica, sans-serif" size="2">Username</font></td> </tr> <tr> <td width="5%"></td> <td><input type="text" name="username" size="14"></td> </tr> <tr> <td colspan="2"><font face="Tahoma, Verdana, Arial, Helvetica, sans-serif" size="2">Password</font></td> </tr> <tr> <td width="5%"></td> <td><input type="text" name="password" size="14"></td> </tr> <tr> <td colspan="2"><div align="center"><center><p><input src="/images/login2.gif" name="I1" width="48" height="14" type="image" align="bottom"> <a href="/signup.php"><img src="/images/register2.gif" width="63" height="14" border="0" align="bottom"></a> </td> </tr> </table> </form> </td> </tr> </table> <BR>

    thats all you need isn't it?

    thx again

  4. #4
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try changin:

    eval("\$loginnblock = \"".template('block_login')."\";");

    To:

    eval("\$loginnblock = \"" . template('block_login') . "\";");

    or

    eval("\$loginnblock = \"" . template('block_login') . "\"");

  5. #5
    SitePoint Member
    Join Date
    Mar 2001
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


    still doesn't work the error is

    Parse error: parse error in /home/jellyman/public_html/index2.php(39) : eval()'d code on line 2

  6. #6
    SitePoint Columnist Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think the " in your template code are breaking the eval code string you are buliding. Try this instead:
    PHP Code:
    eval("\$loginnblock = \"" addslashes(template('block_login')) . "\";"); 


Bookmarks

Posting Permissions

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