FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


DJ-Request





DanielXP
Im making a flat file DJ-Request script but it keeps coming up this error

Parse error: parse error, unexpected T_STRING ..... on line 14

The code is

Code:
<?php

$filename = 'requests.txt';

{
     
     if ($register_globals) $ip = getenv(REMOTE_ADDR);
     else $ip = $_SERVER['REMOTE_ADDR'];

}

function addlink($name,$song,$message,$ip) {
global $filename;
$html = "<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"37%\" id="AutoNumber1\"><tr><td width=\"40%\">Name:</td><td width=\"60%\">$name</td></tr><tr><td width=\"40%\">Song Request:</td><td width=\"60%\">$song</td></tr><tr><td width=\"40%\">Message / Shout Out:</td><td width=\"60%\">$message</td></tr><tr><td width=\"40%\">IP:</td><td width=\"60%\">$ip</td></tr></table>\n";
$fp = fopen($filename, 'a+');



fputs($fp, $html) or die("Could not open file!");
echo 'Your message has been sent.<br><br>';

}


If (!$name){
   print "You must enter your name";
} else {
   addlink($name,$song,$message,$ip);

}


?>
<FORM>
<INPUT TYPE="button" VALUE="Go Back" onClick="history.back()">
</FORM>



Please help Very Happy
DanielXP
Ps. i made this from my old link adder so thats why it says

function addlink


Ect . . . Confused
Ducksteina
The $html line is horrible! You forgot to escape an ".
Just use ' instead of ", so you can use " in the variable.

Code:
<?PHP
$html = '<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="37%" id="AutoNumber1"><tr><td width="40%">Name:</td><td width="60%">' . $name . '</td></tr><tr><td width="40%">Song Request:</td><td width="60%">' . $song . '</td></tr><tr><td width="40%">Message / Shout Out:</td><td width="60%">' . $message . '</td></tr><tr><td width="40%">IP:</td><td width="60%">' .$ip .'</td></tr></table>\n';
?>
DanielXP
WORKS Thanks!
DanielXP
Only one problem the thing does not create a new line now and that maked the admin area useless coz the can only delete all and as it only shows as one line it says

Currently: 1 Request(s)
DanielXP
* Bump *

Still not working if you can help that would be cool
Extremeh
Hey was wondering if anyone had a dj song request code that outputs to a different webpage....
example if the request box is on the index page n when they click submit it send the info to like requestpage..

I am looking for a request to do that.. if anyone has the code please email me at admin@ex-tremehosting.co thanks
Related topics
Where should I post a request?
Can we request 1 more cpanel hosting with same account?
Favourite DJ ?
DJ turntable out of an old mouse
Hosting Request method
what is the best song of DJ-Tiesto
QuickReply Box (Request)
Hosting request gone!
Can't Find My hosting Request
My Hosting Request Disappeared!
what happen to request hosting?...
The new Account page and Request Mod
HOw to Request A host
Studio 64-DJ's Graphic Shop
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.