Jump to content

can anyone see what is wrong with this script?


darkmonk

Recommended Posts

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>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.