Texas Posted September 18, 2009 Posted September 18, 2009 I'm using mc lite and I need some help adding a simple script for an ad on my login page. I'm not use to seeing the html stuff inside the <?php. Usually my pages start out like this: <html> <title></title> <head> </head> <body> <script></script> <?php My php here ?> </body> </html> But lite does it this way <?php session_start(); print <<<EOF <html> <head> yada yada yada print "</body></html>"; ?> How do I add my <script></script> where the "yada yada yada" is? lol Because I keep getting this error message: Parse error: syntax error, unexpected '<' in /home/content/X/X/X/XXXXXXXX/html/login.php on line 126 Quote
BlueDevil23 Posted September 18, 2009 Posted September 18, 2009 Post the login.php here, and I'll help you out. Quote
Texas Posted September 18, 2009 Author Posted September 18, 2009 Right now, I'm just trying to get it up and running. But I'll keep that in mind. Thanks! Quote
Nickson Posted September 18, 2009 Posted September 18, 2009 If your script is a javascript file it can be linked by simply using <script src = "location"> ... else you'll need to throw in the full javascript code between the script tags as you would actually use it yourself by doing <html> <title></title> <head> </head> <body> <script> javascript code</script> now mcc lite uses it differently as you said, you still need to do the very same to the html, like below <?php session_start(); print <<<EOF <html> <head> <script> javascript code</script> more html yada yada yada print "</body></html>"; ?> as you can see, this is actually exact the same, only difference is that there is an php print around it. Parse error: syntax error, unexpected '<' in /home/content/X/X/X/XXXXXXXX/html/login.php on line 126 this error just tells you it comes across an "<" sign where it doesn't expect one. so check lines 124 to 128 (eventually copy and paste them into here) and make sure there are no php errors. Quote
Texas Posted September 18, 2009 Author Posted September 18, 2009 it gives me that error message, if I add <script>my script</script> or <font="#000000">my text</font> in between the <?php and ?> I get the same error message no matter what i add to the code. Quote
Nickson Posted September 18, 2009 Posted September 18, 2009 I'm pretty sure it's not because you're trying to add something, it's more likely you are adding it in the wrong way to a php script. I would really advise you to paste the lines around the error line ... this would help us a lot in helping you with your problem, else I'm afraid we can't help much. Quote
Texas Posted September 18, 2009 Author Posted September 18, 2009 <h3>REGISTER NOW!</h3> <center>Copyright © 2009 Kidkwik.com</center>"; <script type="text/javascript"><!-- google_ad_client = "pub-2439858441801001"; /* 468x60, created 9/8/09 */ google_ad_slot = "4082761804"; google_ad_width = 468; google_ad_height = 60; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> print "</body></html>"; ?> Line 126 - is the red writting Parse error: syntax error, unexpected '<' in /home/content/X/X/X/XXXXXXXX/html/login.php on line 126 Quote
Nickson Posted September 18, 2009 Posted September 18, 2009 clearly, you haven't looked far into the basics of PHP, which you should if you want to continue with it. your problem is that you just pasted some html code into a php script, you cannot do that! You need to print/echo everything into the page so it reaches the browser of a user, and does not get processed by the php interpreter. Use the code below and you should be fine, but again, look into the basics of php, as it's a fault you made against that. <h3>[url='register.php']REGISTER NOW![/url]</h3> <center>Copyright © 2009 Kidkwik.com</center>"; print <<<EOG <script type="text/javascript"><!-- google_ad_client = "pub-2439858441801001"; /* 468x60, created 9/8/09 */ google_ad_slot = "4082761804"; google_ad_width = 468; google_ad_height = 60; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> EOG; print "</body></html>"; ?> Quote
Texas Posted September 19, 2009 Author Posted September 19, 2009 Yes, I am just now learning to use php and I don't quite get it just yet, but we all have to start some where right. Thanks for the help but your code doesn't work either. Parse error: syntax error, unexpected '<' in /home/content/k/i/d/kidkwik/html/login.php on line 126 print <<<EOG <script type="text/javascript"><!-- google_ad_client = "pub-2439858441801001"; /* 468x60, created 9/8/09 */ google_ad_slot = "4082761804"; google_ad_width = 468; google_ad_height = 60; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> EOG; print "</body></html>"; ?> Quote
Nickson Posted September 19, 2009 Posted September 19, 2009 The code I supplied does work, I just tested this out on a test page, and it shows without any errors at all so it must be on your end. Please post the whole scrip as it must be something else then. Quote
Texas Posted September 19, 2009 Author Posted September 19, 2009 crap... sorry, here it is. :::EDIT EDIT EDIT::: 30 minutes later, it works. Must be the stupid cookies. Even though I deleted them prior to reloading. So I dunno... thanks. Quote
mdshare Posted September 19, 2009 Posted September 19, 2009 Always have a cache clean when you changed something on your website, a simple CTRL-F5 does wonders Quote
Texas Posted September 19, 2009 Author Posted September 19, 2009 ok thanks for the info Next question: Crons? Daily Update Cron Message: /home/content/k/i/d/kidkwik/html/cron_day.php: line 1: ?php: No such file or directory /home/content/k/i/d/kidkwik/html/cron_day.php: line 2: include: command not found /home/content/k/i/d/kidkwik/html/cron_day.php: line 3: global: command not found /home/content/k/i/d/kidkwik/html/cron_day.php: line 4: syntax error near unexpected token `'cron_day.php','',$_SERVER['SCRIPT_NAME']' /home/content/k/i/d/kidkwik/html/cron_day.php: line 4: `$path=$_SERVER['HTTP_HOST'].str_replace('cron_day.php','',$_SERVER['SCRIPT_NAME']); ------------------------------------ Cron Daily Update.php <?php include "mysql.php"; global $c, $mykey; $path=$_SERVER['HTTP_HOST'].str_replace('cron_day.php','',$_SERVER['SCRIPT_NAME']); if($_GET['code'] != md5($path.$mykey)) { exit; } mysql_query("UPDATE users SET daysold=daysold+1",$c); mysql_query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0",$c); mysql_query("UPDATE fedjail set fed_days=fed_days-1",$c); mysql_query("UPDATE users u LEFT JOIN fedjail f ON u.fedjail=f.fed_id SET u.fedjail=0 WHERE f.fed_days=0",$c); mysql_query("DELETE FROM fedjail WHERE fed_days=0",$c); ?> and the 5 minute revive message I get: /home/content/k/i/d/kidkwik/html/cron_fivemins.php: line 1: ?php: No such file or directory /home/content/k/i/d/kidkwik/html/cron_fivemins.php: line 2: include: command not found /home/content/k/i/d/kidkwik/html/cron_fivemins.php: line 3: global: command not found /home/content/k/i/d/kidkwik/html/cron_fivemins.php: line 4: syntax error near unexpected token `'cron_fivemins.php','',$_SERVER['SCRIPT_NAME']' /home/content/k/i/d/kidkwik/html/cron_fivemins.php: line 4: `$path=$_SERVER['HTTP_HOST'].str_replace('cron_fivemins.php','',$_SERVER['SCRIPT_NAME']);' Cron 5 minute.php <?php include "mysql.php"; global $c, $mykey; $path=$_SERVER['HTTP_HOST'].str_replace('cron_fivemins.php','',$_SERVER['SCRIPT_NAME']); if($_GET['code'] != md5($path.$mykey)) { exit; } $query="UPDATE users SET energy=energy+(maxenergy/(12.5)) WHERE energy<maxenergy"; $query2="UPDATE users SET energy=maxenergy WHERE energy>maxenergy"; $query3="UPDATE users SET will=will+10 WHERE will<maxwill"; $query4="UPDATE users SET will=maxwill WHERE will>maxwill"; mysql_query($query,$c) or die("\nError Executing Query 1 for updating users $i to $next\n$query\n".mysql_error()."\nError Code:".mysql_errno()); mysql_query($query2,$c) or die("\nError Executing Query 2 for updating users $i to $next\n$query2\n".mysql_error()."\nError Code:".mysql_errno()); mysql_query($query3,$c) or die("\nError Executing Query 3 for updating users $i to $next\n$query3\n".mysql_error()."\nError Code:".mysql_errno()); mysql_query($query4,$c) or die("\nError Executing Query 4 for updating users $i to $next\n$query4\n".mysql_error()."\nError Code:".mysql_errno()); $query="UPDATE users SET brave=brave+((maxbrave/10)+0.5) WHERE brave<maxbrave "; $query2="UPDATE users SET brave=maxbrave WHERE brave>maxbrave"; $query3="UPDATE users SET hp=hp+(maxhp/3) WHERE hp<maxhp"; $query4="UPDATE users SET hp=maxhp WHERE hp>maxhp"; mysql_query($query,$c) or die("\nError Executing Query 1 for updating users $i to $next\n$query\n".mysql_error()."\nError Code:".mysql_errno()); mysql_query($query2,$c) or die("\nError Executing Query 2 for updating users $i to $next\n$query2\n".mysql_error()."\nError Code:".mysql_errno()); mysql_query($query3,$c) or die("\nError Executing Query 3 for updating users $i to $next\n$query3\n".mysql_error()."\nError Code:".mysql_errno()); mysql_query($query4,$c) or die("\nError Executing Query 4 for updating users $i to $next\n$query4\n".mysql_error()."\nError Code:".mysql_errno()); ?> The energy, brave and will bars haven't moved at all and GoDaddy's support is basically no help at all. I have been trying different paths for two days just to get the crons to execute. Because the path they suggested, was nothing close to what it needed. They have their own cron manager instead of cpanel I have them executing now, but they don't seem to be doing anything. Quote
Uridium Posted September 21, 2009 Posted September 21, 2009 Godaddy isnt the best for setting up any game or website. I remember when i was with them it was a hassle just to set up a Dbase as they dont use localhost.. Your best bet is get anotehr HOSt and steer clear of godaddy their support is an automated bot you'll never talk to a human Quote
Texas Posted September 23, 2009 Author Posted September 23, 2009 thanks, I got it to working though. I went back to using ezRPGs engine. Seems to work better on GoDaddy then MCs engine does. Runs alot smoother and doesn't hesitate when loading. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.