Welcome Guest ( Log In | Register)



 
Closed TopicStart new topic
> Question About Php Script [resolved], Read please!
Imtay22
post Jun 21 2007, 08:11 PM
Post #1


Super Member
*********

Group: [HOSTED]
Posts: 299
Joined: 27-January 07
From: Winter is cold here.
Member No.: 37,984
Spam Patrol



CODE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<title>Rune Mods</title>
</head>
<body>
<a href="?mode=idx">Home- Under Construction</a> - <a href="?mode=login">Login</a> - <a href="?mode=register">Register</a><br>
<?php
$page=$_GET['mode'];
switch($page){
case 'login';
include ("login.php");
break;
case 'register';
include ("register.php");
break;
default:
echo "Under Constrution<br /> Please <a href="?mode=login">Login</a> or <a href="?mode=register">Register</a>";
break;
}
?>
</body>
</html>


And then I get the error-

QUOTE
Parse error: syntax error, unexpected '=' in /home/imtay22/public_html/index.php on line 19


Please help!

Oh wow I found the problem. Line 19 has the double quotes for the HTML and the php. So I just switched the php ones to single quotes!

This post has been edited by Imtay22: Jun 21 2007, 08:14 PM
Go to the top of the page
 
+Quote Post
matak
post Jun 21 2007, 08:23 PM
Post #2


Super Member
*********

Group: Members
Posts: 413
Joined: 4-October 06
From: Psychedelic Realms
Member No.: 31,079



Try this

CODE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<title>Rune Mods</title>
</head>
<body>
<a href="?mode=idx">Home- Under Construction</a> - <a href="?mode=login">Login</a> - <a href="?mode=register">Register</a><br>
<?php
$page=$_GET['mode'];
switch($page){
case 'login':
include ("login.php");
break;
case 'register':
include ("register.php");
break;
default:
echo "Under Constrution<br /> Please <a href=\"?mode=login\">Login</a> or <a href=\"?mode=register\">Register</a>";
break;
}
?>
</body>
</html>


You need to escape special characters in echo, and use : instead of ; in case

This post has been edited by matak: Jun 21 2007, 08:24 PM
Go to the top of the page
 
+Quote Post
Imtay22
post Jun 21 2007, 08:31 PM
Post #3


Super Member
*********

Group: [HOSTED]
Posts: 299
Joined: 27-January 07
From: Winter is cold here.
Member No.: 37,984
Spam Patrol



Well it works now, it was just the quote-double quote thing. SO now it works. This topic can be closed now!
Go to the top of the page
 
+Quote Post
matak
post Jun 21 2007, 08:35 PM
Post #4


Super Member
*********

Group: Members
Posts: 413
Joined: 4-October 06
From: Psychedelic Realms
Member No.: 31,079



QUOTE(Imtay22 @ Jun 21 2007, 10:31 PM) *
Well it works now, it was just the quote-double quote thing. SO now it works. This topic can be closed now!


this topic must be closed right now.. laugh.gif
Go to the top of the page
 
+Quote Post

Closed TopicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Guestbook (cgi-script) Problems(5)
  2. Last Book You Read?(202)
  3. Trap17 Link Exchange Script Introduced(28)
  4. Welcome All New Registered Users Of Trap17(0)
  5. Need Help With Javascript Drag And Drop Script(2)
  6. Java Script To Hide The Url In Address Bar(6)
  7. Mac To Read Microsoft Word(3)
  8. Jsp Or Java Chat Script Like Mig33(5)
  9. **** Read Before You Post! ****(48)
  10. Many Php Script Sites(16)
  11. Read This Before Applying For Hosting!(58)
  12. Tracking My Stolen Laptop(8)
  13. Very Simple Online Now Script(4)
  14. Eragon(54)
  15. [request] Avatar For Trap17 Users(0)
  1. [help] Java Script: Window.open(10)
  2. Who Is The Best Writer Did You Ever Read And His Or Her Book(11)
  3. Sendearnings.com(17)
  4. Im Making A Mmorpg >>(14)
  5. Verifying Email Addresses(9)
  6. Trap17 Gets Supernatural: Topics Disappear!(7)
  7. Read This At Any Cost Before Posting Here(8)
  8. Delay X Seconds In Flash(1)
  9. Read-only Folders In Xp(13)
  10. Web Surfing- Script Needed(2)
  11. Seeking Help With Javascript(1)
  12. Browser Compatibility Problem With Firefox - Javascript + Css(3)
  13. Living Everyday Happily And Meaningfully(5)
  14. Dvd Drive Problem(10)
  15. Compatibility/major Question(5)


 



- Lo-Fi Version Time is now: 10th October 2008 - 08:09 PM