473,734 Members | 2,824 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Another... Parse error: syntax error, unexpected $end

1 New Member
Hey.. I've been working on these sign up / log in forms for my new Game Site, and everything else in the game works but the registration!! I keep ketting the unexpected $end and Im tired of it! Here is the code... SOMEBODY PLEASE HELP ME!! I'm going crazy! haha

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. //This contains user stuffs
  3. switch($_GET['action'])
  4. {
  5. case 'newuser': new_user_form(); break;
  6. case 'newusersub': new_user_submit(); break;
  7. case 'edituser': edit_user_begin(); break;
  8. case 'edituserform': edit_user_form(); break;
  9. case 'editusersub': edit_user_sub(); break;
  10. case 'invbeg': inv_user_begin(); break;
  11. case 'invuser': inv_user_view(); break;
  12. case 'deleinv': inv_delete(); break;
  13. case 'creditform': credit_user_form(); break;
  14. case 'creditsub': credit_user_submit(); break;
  15. case 'masscredit': mcredit_user_form(); break;
  16. case 'masscreditsub': mcredit_user_submit(); break;
  17. case 'reportsview': reports_view(); break;
  18. case 'repclear': report_clear(); break;
  19. case 'deluser': deluser(); break;
  20. case 'forcelogout': forcelogout(); break;
  21. }
  22. function htmlspcl($in)
  23. {
  24. return str_replace("'", "'", htmlspecialchars($in));
  25. }
  26. function new_user_form()
  27. {
  28. print "Registration<br />
  29. <form action='register.php method=post?action=newusersub' method='post'>
  30. Username: <input type='text' name='username' /><br />
  31. Email: <input type='text' name='email' /><br />
  32. Password: <input type='text' name='userpass' /><br />
  33. Your Referrers ID:</td><td><input type=text name=referrer value='".$_GET["REF"]."'><br /> <br />
  34. <input type='submit' value='Create User' /></form>";
  35. }
  36. {
  37. if($_POST['password'] != $_POST['cpassword'])
  38. {
  39. print "<b>Registration</b><form action=register.php method=post><table width='75%' border='0'>
  40. <tr>
  41. <td colspan='2' align='center'><span style='color:red; font-weight: 800;'>! ERROR: The passwords did not match</span></td>
  42. </tr>
  43. <tr>
  44. <td width='50%'>Username:</td><td><input type=text name='username'></td>
  45. </tr>
  46. <tr>
  47. <td width='50%'>Password:</td><td><input type=password name='userpass'></td>
  48. </tr>
  49. <tr>
  50. <td width='50%'>Confirm Password:</td><td><input type=password name='cpassword'></td>
  51. </tr>
  52. <tr>
  53. <td width='50%'>E-Mail Address:</td><td><input type=text name='email' ><br> <font color=red>Must be valid in order to activate your account!!!!!!</font></td>
  54. </tr>
  55. <tr>
  56. <td width='50%'>Your Referrers ID:</td><td><input type=text name=referrer value=".$_GET["REF"]."'></td>
  57. </tr>
  58. <tr>
  59. <td colspan='2' align='center'><input type='submit' value='Create User' /></td>
  60. </tr></table></form>";
  61. }
  62. exit;
  63. {
  64. $r=@mysql_fetch_array($q);
  65. $pass=strip_tags($r['userpass']);
  66. $pass=md5($pass);
  67. $username=($r['username']);
  68. $email=($r['email']);
  69. $money=($r['money']);
  70. $db->query("INSERT INTO users (username, userpass,level, money, crystals, donatordays, energy, maxenergy, will, maxwill,brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney) VALUES( '{$_POST['username']}', md5('{$_POST['userpass']}'), '1', '1000', '0', '3', '12', '12', 100, 100, '3', '3', '100', '100', 1, '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}', -1)");
  71. $i=@mysql_insert_id($c);
  72.  
  73. mail( $_POST['email'], "Murder Town Account Validation",
  74. "Hi {$username},
  75.  
  76. Your email has just been used to register an account on Mafia Fight Club.
  77.  
  78. To validate your account, copy and paste this into your browsers address bar:
  79. http://www.murder-town.com/validate.php?act=val&token=$key
  80. <a href='http://www.murder-town.com/validate.php?act=val&token=$key'>AOL users click here to validate your account</a>
  81.  
  82. Or to cancel the registration:
  83. http://www.murder-town.com/validate.php?act=can&token=$key
  84. <a href='http://www.murder-town.com/validate.php?act=can&token=$key'>AOL users click here to cancel your account</a>
  85.  
  86. Username: $username
  87. Password: {$_POST['userpass']}
  88.  
  89. Thanks,
  90. Diego ", "From: validations@murder-town.com");
  91. mysql_query("UPDATE users SET crystals='crystals+8' WHERE userid={$_POST['referrer']}",$c) or print mysql_error();
  92. print "<b>Registration Complete</b><br />
  93. Please check your email to validate your Mafia Fight Club account and begin playing or go login.<br>
  94. <b>Note:</b> The email may have been sent to your spam/junk box, please check these if you cannot find it.<br>";
  95. $q = mysql_query("SELECT `username` FROM `users` WHERE `userid` = ".$_POST["referrer"]."") or print mysql_error();
  96. print "<i>For reffering you to Murder Town, ".mysql_result($q,0,0)." has recieved eight crystals!";
  97. }
  98. {
  99. print "<b>Registration Complete</b><br>
  100. Please check your email..our validation link is acting abnormal so if it doesnt not work, message Diego at joerollsresurrected@hotmail.com to validate your Mafia Fight Club account and begin playing.<br>
  101. <b>Note:</b> The email may have been sent to your spam/junk box, please check these if you cannot find it.<br><b>You have until midnight EST to validate your account, and the staff is online at all times.<br> Please do so as soon as possible or it will be deleted.</b>";
  102. }
  103. {
  104. print "<b>Registration</b><br />
  105. You will receive an email to the address you specify, follow the instructions there to validate your account.
  106. <form action=register.php method=post><table width='400' border='1'>
  107. <tr>
  108. <td width='50%'>Username:</td><td><input type=text name=userid></td>
  109. </tr>
  110. <tr>
  111. <td width='50%'>Password:</td><td><input type=password name=password></td>
  112. </tr>
  113. <tr>
  114. <td width='50%'>Confirm Password:</td><td><input type=password name=cpassword></td>
  115. </tr>
  116. <tr>
  117. <td width='50%'>E-Mail Address:</td><td><input type=text name=email><br> <font color=red>Must be valid</font></td>
  118. </tr>
  119. <tr>
  120. <td width='50%'>Your Referrers ID:</td><td><input type=text name=referrer value='".$_GET["REF"]."'></td>
  121. </tr>
  122. <tr>
  123. <td width='50%'>Promo Code:</td><td><input type=text name=promo></td>
  124. </tr>
  125. <tr>
  126. <td colspan='2' align='center'><input type='submit' value='Register' /></td>
  127. </tr></table></form>";
  128. {
  129. print "Registration Complete!<br />
  130. <a href='login.php'>&gt; Go to Login</a>";
  131. }
  132. $h->endpage();
  133. ?>
Oct 12 '07 #1
1 6467
nathj
938 Recognized Expert Contributor
Hi,

I've had a look over the code and I think the problem is with the { characters you've got, the } don't atch up. One example of this is on line 72 - it appears that there is a'{' that is not needed.

There are a couple of overs with the IF structure you use. I'd read through the code and make sure they all match properly. Then try it again.

Cheers
nathj
Oct 12 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2294
by: Janwillem Borleffs | last post by:
Q: I'm getting an unexpected $ or $end parse/syntax error, what's causing this? A: This is caused when an expression is started with an opening brace, but the closing brace is omitted. Examples: if ($condition) { .... // No closing brace; the error is thrown
8
46196
by: Wescotte | last post by:
The error message Parse error: syntax error, unexpected $end in FILE on line X is one I run into frequently and I know the cause is I missed an ending quote. Is there an easy way to determine where the inital " started? I find myself adding /* */ blocks or cutting/pasting sections of code out in order to find where the error occured. Wouldn't it it be nice if the warning message included the line in teh source where the initial quote ...
4
22155
kestrel
by: kestrel | last post by:
I have some html code that is supposed to be displayed by php echo. But for some reason i keep getting a syntax error, and i cant figure out what is going on. Heres what i have <?php if(isset($_GET)) { echo "<div id="visible">"; echo "<span onclick="swapform()">Log In Form</span>"; echo "</div>"; echo "<div id="theform" style="visibility: hidden">";
36
8003
by: rhys | last post by:
My Gurus and Angels -- Please pardon this old-school programmer, only recently enlightened to open-source, having been trapped in the convenience of proprietary lingos for way too long. My shortcomings will soon become apparent. I am developing an estimating construction system, using PHP5 and MySQL 5.0.24a with Ubuntu. I have a main "projects" file, and 2 detail files, one for piping and one for equipment. Each of these files will have...
5
10029
praclarush
by: praclarush | last post by:
I've just started php, and this is a class assignment, but my question is I’m getting this error PHP Parse error: syntax error, unexpected T_IF, expecting T_VARIABLE or '$' in C:\wamp\www\ssp\SSP04\guessingGame.php on line 42. I’ve tried to make sense of it but I’m at a lose, there error is referring to this segment of the code. else{ if(!isset($_GET)){ echo "<p>****</p>"; $guess = "****"; }//end if //declaring some...
9
4030
by: ajd335 | last post by:
Hi all... I am getting an error Parse error: syntax error, unexpected $end in http:/..... on line 117...(117 is the EOF).. can you plz help me out..I have checked out for the < , > ,{ ,} etc.... I donno where m wrong.... <?php class S_Shipping { // Private variables.
2
3242
by: fburn | last post by:
I need some help with an error I'm getting using php 5.2.5 running on linux. I receive an error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/html/inventoryControl/supplier.php on line 26 (line number changed to match code tags) The code is as follows: // get a supplier using the supplier id
9
3531
akohistani
by: akohistani | last post by:
I am having Parse error problem with my newly purchased Php upload script I have uploaded the script and I get the error below Parse error: syntax error, unexpected $end in URL/functions.php on line 400 Someone please help me I contacted the owner of the script where I purchased he is not replying me I bought it from http://www.scubadivingcalculators.com/ and this is the url where I have uploaded the script...
10
5665
by: benicio | last post by:
Parse error: syntax error, unexpected T_STRING, expecting '(' in C:\wamp\www\study_group\includes\functions.php on line 19 I got this error and this syntax is from 8 to 19th line. <?php $subject_set = get_all_subjects(); while ($subject = mysql_fetch_array($subject_set)) { echo "<li>{$subject}</li>"; $page_set = get_pages_for_subject($subject);
0
9452
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9184
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8187
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6737
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4551
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4813
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3262
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.