SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Thread: Parse Error?

  1. #1
    The I's for intelligent silver trophy iTechno's Avatar
    Join Date
    Jan 2006
    Location
    Yorkshire, UK
    Posts
    1,796
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Parse Error?

    Hey Guys...

    I was wondering If I could get some advice. First off I am a total novice at PHP so this may sound really easy to some. Ok, Right, I downloaded a script for vB which basically allows a login box on another page. I installed all and it worked fine then I started editing it, styling it and I get

    Code:
    Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/dcasing/public_html/skypedaily/forums/login_inc2.php on line 15
    My question is can I edit it so that it will let me style?

    www.skypedaily.com/index.php is the "External page".
    www.skypedaily.com/login_inc.php is where the 1 part of the script is. www.skypedaily.com/forums/login_inc2.php is where the other part is.

    Regards.

  2. #2
    Non-Member Icheb's Avatar
    Join Date
    Mar 2003
    Location
    Germany
    Posts
    1,474
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So you don't think it would be useful to actually give us the source code, at least line 15?

  3. #3
    The I's for intelligent silver trophy iTechno's Avatar
    Join Date
    Jan 2006
    Location
    Yorkshire, UK
    Posts
    1,796
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Must have caught me uploading, both pages are default (working) now.

  4. #4
    SitePoint Member Sicloan's Avatar
    Join Date
    Nov 2005
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should really put quotes around your values...

    HTML Code:
    	<form action="/forums//login.php" method="post "onsubmit="md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_utf)">
    	<script type="text/javascript" src="/forums//clientscript/vbulletin_md5.js"></script>
    User Name:
    	<input name="vb_login_username" type="text" id="navbar_username" onfocus="if (this.value == '') this.value = '';" size="10" />
    	<br />		
    	Password:<input name="vb_login_password" type="password" size="10" />
    	<br />
    		
    	<label for="cb_cookieuser_navbar"><input name="cookieuser" type="checkbox" id="cb_cookieuser_navbar" value="1" checked="checked" />
    	Remember Me?<br /></label>
    
    	
    		
    	<input type="submit" title="" value="Log In" />
    		
    	<input type="hidden" name="s" value="" />
    	<input type="hidden" name="do" value="login" />		
    	<input type="hidden" name="vb_login_md5password" />
    	<input type="hidden" name="vb_login_md5password_utf" />
    
    	</form>

  5. #5
    Non-Member Icheb's Avatar
    Join Date
    Mar 2003
    Location
    Germany
    Posts
    1,474
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    We need the actual PHP source code.

  6. #6
    The I's for intelligent silver trophy iTechno's Avatar
    Join Date
    Jan 2006
    Location
    Yorkshire, UK
    Posts
    1,796
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Login_inc2.php
    Code:
    <?php
    // Edit the line below to show path to your forums
    $forumpath = "/forums/";
    
    
    // You dont have to edit anything underneath here,
    // but you can if you wish to style the login box
    // to match the style of your site.
    
    
    // We check if user is logged in
    if ($vbulletin->userinfo['userid']!=0) {
    
    // If Logged in display welcome back message
    echo "Welcome Back, ";
    echo $vbulletin->userinfo['username'];
    echo " !<br />";
    
    
    } else { // If user is not logged in, we do this stuff
    
    
    // Display login boxes + button
    // You can style this with html or CSS as normal if desired.
    echo"
    	<form action=\"".$forumpath."/login.php\" method=post onsubmit=md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_utf)>
    	<script type=text/javascript src=\"".$forumpath."/clientscript/vbulletin_md5.js\"></script>
    User Name:
    	<input name=vb_login_username type=text id=navbar_username onfocus=if (this.value == '$vbphrase[username]') this.value = ''; size=10 />
    	<br />		
    	Password:<input name=vb_login_password type=password size=10 />
    	<br />
    		
    	<label for=cb_cookieuser_navbar><input name=cookieuser type=checkbox id=cb_cookieuser_navbar value=1 checked=checked />
    	Remember Me?<br /></label>
    	
    		
    	<input type=submit title=$vbphrase[enter_username_to_login_or_register] value=\"Log In\" />
    		
    	<input type=hidden name=s value=$session[sessionhash] />
    	<input type=hidden name=do value=login />		
    	<input type=hidden name=vb_login_md5password />
    	<input type=hidden name=vb_login_md5password_utf />
    
    	</form>
    ";
    
    }
    ?>
    login_inc.php
    Code:
    <?php
    // Edit the line below to show path to your forums
    $forumpath = "/forums/";
    
    
    // You dont have to edit anything underneath here,
    // but you can if you wish to style the login box
    // to match the style of your site.
    
    
    // We check if user is logged in
    if ($vbulletin->userinfo['userid']!=0) {
    
    // If Logged in display welcome back message
    echo "Welcome Back, <b>";
    echo $vbulletin->userinfo['username'];
    echo " !</b><br>";
    
    // If logged in display logout link
    echo "<a href=\"".$forumpath."login.php?$session[sessionurl]do=logout&amp;logouthash=$logouthash";
    echo $vbulletin->userinfo['logouthash'];
    echo "\">";
    echo "<font size=\"1\" face=\"verdana\">Log Out</font></a>
    ";
    
    } else { // If user is not logged in, we do this stuff
    
    
    // Display login boxes + button
    // You can style this with html or CSS as normal if desired.
    echo"
    	<form action=\"".$forumpath."/login.php\" method=post onsubmit=md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_utf)>
    	<script type=text/javascript src=\"".$forumpath."/clientscript/vbulletin_md5.js\"></script>User Name:
    	<input name=vb_login_username type=text id=navbar_username onfocus=if (this.value == '$vbphrase[username]') this.value = ''; size=10 />
    	<br />		
    	Password:<input name=vb_login_password type=password size=10 />
    	<br />
    		
    	<label for=cb_cookieuser_navbar><input name=cookieuser type=checkbox id=cb_cookieuser_navbar value=1 checked=checked />
    	Remember Me?<br /></label>
    	
    		
    	<input type=submit title=$vbphrase[enter_username_to_login_or_register] value=\"Log In\" />
    		
    	<input type=hidden name=s value=$session[sessionhash] />
    	<input type=hidden name=do value=login />		
    	<input type=hidden name=vb_login_md5password />
    	<input type=hidden name=vb_login_md5password_utf />
    
    	</form>
    ";
    
    }
    ?>

  7. #7
    Non-Member Icheb's Avatar
    Join Date
    Mar 2003
    Location
    Germany
    Posts
    1,474
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you sure that is the version of the file where you get the error? Because from what I can tell there's nothing wrong with it. I even saved it and tried to run it, which didn't return any parse errors.

  8. #8
    The I's for intelligent silver trophy iTechno's Avatar
    Join Date
    Jan 2006
    Location
    Yorkshire, UK
    Posts
    1,796
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When I try to style it it has errors ie...

    Code:
    <?php
    // Edit the line below to show path to your forums
    $forumpath = "/forums/";
    
    
    // You dont have to edit anything underneath here,
    // but you can if you wish to style the login box
    // to match the style of your site.
    
    
    // We check if user is logged in
    if ($vbulletin->userinfo['userid']!=0) {
    
    // If Logged in display welcome back message
    echo "Welcome Back, ";
    echo $vbulletin->userinfo['username'];
    echo " !<br />";
    
    
    } else { // If user is not logged in, we do this stuff
    
    
    // Display login boxes + button
    // You can style this with html or CSS as normal if desired.
    echo"
    	<form action=\"".$forumpath."/login.php\" method=post onsubmit=md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_u  tf)>
    	<script type=text/javascript src=\"".$forumpath."/clientscript/vbulletin_md5.js\"></script>
    User Name:
    	<input name=vb_login_username type=text id=navbar_username onfocus=if (this.value == '$vbphrase[username]') this.value = ''; size=10 />
    	<br />		
    	<label class="pass">Password:</label><input name=vb_login_password type=password size=10 />
    	<br />
    		
    	<label for=cb_cookieuser_navbar><input name=cookieuser type=checkbox id=cb_cookieuser_navbar value=1 checked=checked />
    	Remember Me?<br /></label>
    	
    		
    	<input type=submit title=$vbphrase[enter_username_to_login_or_register] value=\"Log In\" />
    		
    	<input type=hidden name=s value=$session[sessionhash] />
    	<input type=hidden name=do value=login />		
    	<input type=hidden name=vb_login_md5password />
    	<input type=hidden name=vb_login_md5password_utf />
    
    	</form>
    ";
    
    }
    ?>

  9. #9
    Non-Member Icheb's Avatar
    Join Date
    Mar 2003
    Location
    Germany
    Posts
    1,474
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So I just wasted my time looking for parse errors in a file that you know is completely fine. Get some other idiot to help you.

  10. #10
    The I's for intelligent silver trophy iTechno's Avatar
    Join Date
    Jan 2006
    Location
    Yorkshire, UK
    Posts
    1,796
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by iTechno
    Must have caught me uploading, both pages are default (working) now.
    Quote Originally Posted by iTechno
    Hey Guys...

    I was wondering If I could get some advice. First off I am a total novice at PHP so this may sound really easy to some. Ok, Right, I downloaded a script for vB which basically allows a login box on another page. I installed all and it worked fine then I started editing it, styling it and I get

    Code:
    Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/dcasing/public_html/skypedaily/forums/login_inc2.php on line 15
    My question is can I edit it so that it will let me style?

    www.skypedaily.com/index.php is the "External page".
    www.skypedaily.com/login_inc.php is where the 1 part of the script is. www.skypedaily.com/forums/login_inc2.php is where the other part is.

    Regards.
    Please read my posts :d. All posts indicated that I had changed it back now.

    Thanks for your help though.


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
  •