darkmonk Posted April 27, 2011 Share Posted April 27, 2011 its been over 3 years since i last modded this script.... well its been 3 years since i have done any scripting! and even back then i was very amateurish!! i tried to run the install file and its telling me theres a fault in "line 3" of this script. <?php include("config.php"); session_start(); if (session_is_registered("user") || session_is_registered("pass")) { // <----LINE 3 include("config.php"); ?> <html> <head> <title><?php print "$title - $site_com"; ?></title> <link rel=stylesheet href=style.css> </head> <body leftmargin=0 rightmargin=0 onload="window.status='<?php print "$site_com"; ?>'"> <?php print "<br><center><a href=news.php>Click Here To Log back in</a><br><br><a href=logout.php>Log Out</a></center>"; exit; } ?> <html> <head> <title><-UNDERGROUND-> [bETA]</title> <link rel=stylesheet href=style.css> </head> <body> <center> <table class=td cellpadding=0 cellspacing=0 width=700><tr><td style="border-bottom: solid black 1px;" bgcolor=eeeeee align=right><b>Gamers-Fusion Version 2.5</td></tr><tr><td align=center> Quote Link to comment https://forums.phpfreaks.com/topic/234883-can-anyone-see-what-is-wrong-with-this-script/ Share on other sites More sharing options...
darkmonk Posted April 27, 2011 Author Share Posted April 27, 2011 this is the error message i am getting when i try to run the install.php script. (i can copy and paste that script here too if needed) Deprecated: Function session_is_registered() is deprecated in D:\wamp\www\UNDERGROUND\head.php on line 3 im using WAMPSERVER 2 Quote Link to comment https://forums.phpfreaks.com/topic/234883-can-anyone-see-what-is-wrong-with-this-script/#findComment-1207024 Share on other sites More sharing options...
PaulRyan Posted April 27, 2011 Share Posted April 27, 2011 The function session_is_registered() is now deprecated, instead we now use $_SESSION. To check a session variable does exist we do isSet($_SESSION['variableNameHere']); Regards, PaulRyan. Quote Link to comment https://forums.phpfreaks.com/topic/234883-can-anyone-see-what-is-wrong-with-this-script/#findComment-1207025 Share on other sites More sharing options...
darkmonk Posted April 27, 2011 Author Share Posted April 27, 2011 ok cheers, now i have the right function its giving me a different error but on the same line heres the top half of the script again but with what you said to change it to: <?php include("config.php"); session_start(); if isSet($_SESSION["user"] || $_SESSION["pass"]) { include("config.php"); ?> this is the error im getting now : Parse error: syntax error, unexpected T_ISSET, expecting '(' in D:\wamp\www\UNDERGROUND\head.php on line 3 Quote Link to comment https://forums.phpfreaks.com/topic/234883-can-anyone-see-what-is-wrong-with-this-script/#findComment-1207030 Share on other sites More sharing options...
fugix Posted April 27, 2011 Share Posted April 27, 2011 for future reference..please encase your php script in the code tags..saves space and eases reading it Quote Link to comment https://forums.phpfreaks.com/topic/234883-can-anyone-see-what-is-wrong-with-this-script/#findComment-1207031 Share on other sites More sharing options...
darkmonk Posted April 27, 2011 Author Share Posted April 27, 2011 sorry.... [code]<?php include("config.php"); session_start(); if isSet($_SESSION["user"] || $_SESSION["pass"]) { include("config.php"); ?> [/code] is this right? never posted code here before as far as i remember lol Quote Link to comment https://forums.phpfreaks.com/topic/234883-can-anyone-see-what-is-wrong-with-this-script/#findComment-1207032 Share on other sites More sharing options...
PaulRyan Posted April 27, 2011 Share Posted April 27, 2011 Your code should look like the following... <?php session_start(); include("config.php"); if (isSet($_SESSION["user"]) || isSet($_SESSION["pass"])) { include("config.php"); } ?> Also, why are you including config.php before the IF/ELSE and in the IF/ELSE? Another thing, you should check to make sure both $_SESSION['user'] AND $_SESSION['pass'] are set, not just 1 or the other Regards, PaulRyan. Quote Link to comment https://forums.phpfreaks.com/topic/234883-can-anyone-see-what-is-wrong-with-this-script/#findComment-1207035 Share on other sites More sharing options...
fugix Posted April 27, 2011 Share Posted April 27, 2011 why are you including config.php twice? and for validation, i would change mt if statement to && instead of || Quote Link to comment https://forums.phpfreaks.com/topic/234883-can-anyone-see-what-is-wrong-with-this-script/#findComment-1207040 Share on other sites More sharing options...
darkmonk Posted April 27, 2011 Author Share Posted April 27, 2011 honestly i dont know....lol like i said i havent seen this script in 3 years....its the gamers-fusion 2.5 that i was modifying when i started to teach myself php but i was only learning for about a week and a half so im not too knowledgeable on php script writing.... work took over too much of my free time for me to carry on but i just got some more time on my hands now i want to really learn and get into it so i can create my game finally! Quote Link to comment https://forums.phpfreaks.com/topic/234883-can-anyone-see-what-is-wrong-with-this-script/#findComment-1207041 Share on other sites More sharing options...
fugix Posted April 27, 2011 Share Posted April 27, 2011 well if you ever have any questions fell free to ask us! Quote Link to comment https://forums.phpfreaks.com/topic/234883-can-anyone-see-what-is-wrong-with-this-script/#findComment-1207050 Share on other sites More sharing options...
darkmonk Posted April 27, 2011 Author Share Posted April 27, 2011 i think i would better off starting from scratch but i honest to god, would not have a clue on how to start. im trying to create a text-based mmorpg browser game....not like a MUD i want to create a game where your click on your options not type in commands. what is the best way to start? i am a complete newbie at php and MySQL so i dont understand some stuff mentioned in so called "beginners tutorials"..... its giving me headache lol Quote Link to comment https://forums.phpfreaks.com/topic/234883-can-anyone-see-what-is-wrong-with-this-script/#findComment-1207059 Share on other sites More sharing options...
PaulRyan Posted April 27, 2011 Share Posted April 27, 2011 LEARNING If you want to start from scratch, I would suggest going over HTML and CSS to begin with. When you've come to speed with those 2, move onto PHP and MySQL. Once you've learnt those 4 languages, I'd look into JavaScript as this really only adds useability and some functionality. I've done this sort of thing before, I still have my old RPG on my local server just to look at and fix up now and again. IDEA You should think up an idea for your Browser-Based RPG, then create a layout/design to suit it's needs. PLANNING Once you have the design, you should write down what features you would like to have in your game such as, Leaderboards, PM System, Forum, PvP, PvE and other things. Then once you're happy with what you've got written down, you should show how each page would interact, what it should do and how it should do it This will be a lengthy process, but it's worth every minute. CREATING Now you've got the essentials to begin coding your game, start with the basic things such as logging in/out, registering and password recovery and such. Then move onto the main features such as PM System, Leaderboards, Games and others. After that you should move onto the best features such PvP, PvE, Quests or whatever. Thats a basic overview Regards, PaulRyan. Quote Link to comment https://forums.phpfreaks.com/topic/234883-can-anyone-see-what-is-wrong-with-this-script/#findComment-1207065 Share on other sites More sharing options...
darkmonk Posted April 27, 2011 Author Share Posted April 27, 2011 i think i'll do just that, any recommendations on sites to learn html and CSS. to learn PHP iv been using w3schools. are web tutorials the best way to go about learning? i'll definitely be doing everything you have mentioned previously! and i will scrap what i have started but not completely! Quote Link to comment https://forums.phpfreaks.com/topic/234883-can-anyone-see-what-is-wrong-with-this-script/#findComment-1207073 Share on other sites More sharing options...
darkmonk Posted April 27, 2011 Author Share Posted April 27, 2011 anyone have any suggestions for tutorials to learn HTML and CSS? Quote Link to comment https://forums.phpfreaks.com/topic/234883-can-anyone-see-what-is-wrong-with-this-script/#findComment-1207084 Share on other sites More sharing options...
KevinM1 Posted April 27, 2011 Share Posted April 27, 2011 Don't use w3schools. It's filled with misinformation. The PHP site itself has great examples. Quote Link to comment https://forums.phpfreaks.com/topic/234883-can-anyone-see-what-is-wrong-with-this-script/#findComment-1207088 Share on other sites More sharing options...
darkmonk Posted April 27, 2011 Author Share Posted April 27, 2011 i have found a site dedicated to teaching HTML and CSS! http://www.html.net/ obvious really lol Quote Link to comment https://forums.phpfreaks.com/topic/234883-can-anyone-see-what-is-wrong-with-this-script/#findComment-1207099 Share on other sites More sharing options...
floridaflatlander Posted April 27, 2011 Share Posted April 27, 2011 anyone have any suggestions for tutorials to learn HTML and CSS? for css, css the missing manual - I used it and I still use it for reference. I first tried "head first html with css" which I needed because I had too take little tiny baby steps. I didn't even know how to spell html . "head first html with css" really walks through html & css, my only complaint is the book falls apart easy. But css the missing manual goes into more detail and is a tough book you can later use for reference. But you sound smart enough to not need head first. Also go to amazon and read the reviews of books, read the bad ones, get an idea what people are b**ching about then go look at the 4 star ratings. To me these are "more likely" the level headed people and they'll answer most of the things the one star raters were b**ching about and you can see if it really matters or if its more likely the user not the book that was the problem. Quote Link to comment https://forums.phpfreaks.com/topic/234883-can-anyone-see-what-is-wrong-with-this-script/#findComment-1207104 Share on other sites More sharing options...
darkmonk Posted April 27, 2011 Author Share Posted April 27, 2011 thank you for that, i am now downloading "CSS: the missing manual" to my kindle for PC! cheers for the recommendations Quote Link to comment https://forums.phpfreaks.com/topic/234883-can-anyone-see-what-is-wrong-with-this-script/#findComment-1207116 Share on other sites More sharing options...
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.