ChrisMartino Posted April 12, 2010 Share Posted April 12, 2010 Can anyone help here this is my register page: <?php // We must include the connection to the Database. include'connection.php'; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Azulmedia</title> <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" /> <meta name="author" content="Erwin Aligam - styleshout.com" /> <meta name="description" content="Site Description Here" /> <meta name="keywords" content="keywords, here" /> <meta name="robots" content="index, follow, noarchive" /> <meta name="googlebot" content="noarchive" /> <link rel="stylesheet" type="text/css" media="screen" href="images/Azulmedia.css" /> </head> <body> <!-- wrap starts here --> <div id="wrap"> <div id="header"> <h1 id="logo">X-<span class="gray">Host</span></h1> <!-- Menu Tabs --> <div id="menu"> <ul> <li><a href="index.html">Home</a></li> <li><a href="index.html">Order</a></li> <li><a href="index.html">Tickets</a></li> <li><a href="index.html">IRC</a></li> <li><a href="index.html">About</a></li> </ul> </div> </div> <!-- content-wrap starts here --> <div id="content-wrap"> <div id="main"> <a name="TemplateInfo"></a> <div class="box"> <?php $URL = $_GET['account']; $URLVALIDATE = $_GET['validate']; // The URL is blank pass the user onto the registration form. if($URL == "") { ?> <h1>Register a new Account<span class="gray"></span></h1> <form id="form1" method="post" action="register.php?account=create"> <label>Register a new account at X-Host, When registering a new account all your information is never given out and kept in great discression. <p align="center"> <label>Username: <br /> <input type="text" name="username" id="username" /> <br /> <br /> Password:<br /> <input type="password" name="password" id="password" /> <br /> <br /> Password(Check):<br /> <input type="text" name="password2" id="password2" /> <br /> <br /> Email: <br /> <input type="text" name="email" id="email" /> <br /> <br /> <input type="submit" name="button" id="button" value="Register Account" /> <br /> </label> </p> </form> <?php } else if($URL = "create") { $ClientUsername = $_POST['username']; $ClientPassword = $_POST['password']; $ClientVerifyPASS = $_POST['password2']; $ClientEmail = $_POST['email']; // Check that the peramiters are the required lengths. if(strlen($ClientUsername) < 5) { // Return a error, Client username less then required chars. echo"<p>Sorry, Username must be more then <b>Five</b> letters</p>"; } else if(strlen($ClientPassoword) < 5) { echo"<p>Sorry, Your password must be more then <b>Five</b> letters</p>"; } else if(strlen($ClientEmail) < 5) { echo"<p>Sorry, Your email must be more then <b>Five</b> letters</p>"; } if($ClientPassword == $ClientVerifyPASS) { // Filter the char's to ensure no injection attempts are present. $CheckedUsername = mysql_real_escape_string($ClientUsername); $CheckedPassword = md5(mysql_real_escape_string($ClientPassword)); $CheckedEmail = mysql_real_escape_string($ClientEmail); $Validation = rand(0, 9000); $Status = 1; $CheckClientUsername = mysql_query("SELECT * FROM Clients WHERE Username = '".$CheckedUsername."'"); $CheckClientEmail = mysql_query("SELECT * FROM Clients WHERE EmailAddress = '".$CheckedEmail."'"); if(mysql_num_rows($CheckClientUsername) == 1) { echo "<h1>Error</h1>"; echo "<p>Sorry, That username is currently taken.</p>"; } else if(mysql_num_rows($CheckClientEmail) == 1) { echo "<h1>Error</h1>"; echo "<p>Sorry, That Email address is already in use by another member.</p>"; } $SubmitRegistration = mysql_query("INSERT INTO Clients (Username, Password, EmailAddress, Validation, Status) VALUES('".$CheckedUsername."', '".$CheckedPassword."', '".$CheckedEmail."', '".$Validation."', '".$Status."')"); if($SubmitRegistration) { echo "<h1>Registation Compleate</h1>"; echo "<p>Your registration was successful, Your account has been created, Please check your email for your validation email, If it dose not appear check your SPAM folder.</p>"; $ValidationCode = mysql_query("SELECT * FROM Clients WHERE Username = '".$CheckedUsername."'"); $row = mysql_fetch_array($ValidationCode); $ValidationCodeURL = "http://no1servers.gta-o.com/register.php?validate=$row[Validation]"; // Send the client a email: $EmailSubject = "X-Host Registration"; $EmailToSend = "<h1>X-Host</h1><br /><p>Thanks for creating a account at X-Host, Providing IV-MP servers at low prices with high quality.<p><br /><p><a href=\"$ValidationCodeURL\">Please click here to validate your account.</a>"; if (mail($ClientEmail, $EmailSubject, $EmailToSend)) { } else { echo("<p>And error occured when sending a email to your email address.</p>"); } } } else { echo"<p>Error, Your password\'s did not match.<p>"; } } else if($URLVALIDATE) { $Stats = 1; $UpdateUser = mysql_query("UPDATE SET `Status` = '".$Stats."' WHERE `Validation` = '".$URLVALIDATE."' LIMIT 1 "); if($UpdateUser) { echo"<p>You're email address has been validated.</p>"; } else { echo"<p>There was a problem with the validation code.</p>"; } } <div align="center"></div></div> </div> </div> <div align="center"><div id="sidebar" > <h2 class="clear">User Accounts</h2> <ul class="sidemenu"> <li><a href="index.html">Login</a></li> <li id="current"><a href="#TemplateInfo">Register</a></li> </ul> <div class="searchform"> <form action="#"> </form> </div> <h2> Network Announcements</h2> <p><strong>12.04.2010</strong> - Main server added the the panel. </p> <h2>Stats</h2> <p>We are currently hosting <> Servers.</p> </div> <br /> <div class="clear"></div> <!-- content-wrap ends here --> </div></div> <div align="center"><!-- wrap ends here --> </div> <!-- footer starts here --> <div id="footer-wrap"> <div class="footer-left"> <p class="align-left"> © 2010 Company Name | <a href="http://www.bluewebtemplates.com/" title="Website Templates">website templates</a> by <a href="http://www.styleshout.com/">styleshout</a> </p> </div> <div class="footer-right"> <p class="align-right"> <a href="index.html">Home</a> | <a href="index.html">SiteMap</a> | <a href="index.html">RSS Feed</a> | <a href="http://validator.w3.org/check/referer">XHTML</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> </p> </div> </div> <!-- footer ends here --> </div></body> </html> and this is my error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home3/chrismar/public_html/no1servers/register.php on line 145 LINE 145: $ValidationCodeURL = "http://no1servers.gta-o.com/register.php?validate=$row[Validation]"; i thought thats right? can anyone help? Link to comment https://forums.phpfreaks.com/topic/198324-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace-expecting-t_str/ Share on other sites More sharing options...
Ken2k7 Posted April 12, 2010 Share Posted April 12, 2010 Try this: $ValidationCodeURL = "http://no1servers.gta-o.com/register.php?validate=".$row[Validation]; or this: $ValidationCodeURL = "http://no1servers.gta-o.com/register.php?validate={$row['Validation']}"; Link to comment https://forums.phpfreaks.com/topic/198324-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace-expecting-t_str/#findComment-1040613 Share on other sites More sharing options...
ChrisMartino Posted April 13, 2010 Author Share Posted April 13, 2010 Try this: $ValidationCodeURL = "http://no1servers.gta-o.com/register.php?validate=".$row[Validation]; or this: $ValidationCodeURL = "http://no1servers.gta-o.com/register.php?validate={$row['Validation']}"; Thanks!, Second one worked the treat Link to comment https://forums.phpfreaks.com/topic/198324-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace-expecting-t_str/#findComment-1040630 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.