SimplePortal

Support => English Support => Topic started by: syphergaming on March 12, 2011, 12:10:19 PM

Title: php block help
Post by: syphergaming on March 12, 2011, 12:10:19 PM
im trying to get this to go in to a php block but every time i try i get a error.

Code: [Select]
<html>
<head>
<title>Radio DJ Panel v3 - Request Line</title>
</head>
<body>
<link rel="stylesheet" type="text/css" href="style_public.css" />

<center><b><u>Request Line</b></u><p>

<?php require('connect.php');
require(
'functions.php');
if(
$_POST['submit']) {
$bname mysql_real_escape_string($_POST['name']);
$btype mysql_real_escape_string($_POST['type']);
$brequest mysql_real_escape_string($_POST['request']);
$name htmlentities($bname);
$type htmlentities($btype);
$request htmlentities($brequest);
$ipaddr $_SERVER['REMOTE_ADDR'];
if (
$bname==NULL|$brequest==NULL){
echo 
"<center><h1><b>All fields are required.</b></h1></center><p>";
}else{
$query "INSERT INTO rp_request (name, type, request, ipaddr) VALUES('$name','$type','$request','$ipaddr')";
mysql_query($query) or die(mysql_error());
echo 
"<p><b>--Your Request Has Been Sent--</b><p>";
}
}
?>


<form method='POST' action='request.php'>
<b>Name:</b><br>
<input type="text" name="name"><p>
<b>Type:</b><br>
<select name="type">
<option selected>Song Request</option>
<option>Shoutout</option>
<option>Competition</option>
<option>Joke</option>
<option>Other</option>
</select><p>
<b>Request:</b><br>
<textarea cols='20' rows='7' name='request'></textarea><p>
<input type='submit' name='submit' value='Request'>
</form>
</body>
</html>
The error i get
Code: [Select]
Syntax error in block code. Please check the code.
if this is a newbie error im sorry but im not to good with php yet im learning

Thanks Mike
Title: Re: php block help
Post by: AngelinaBelle on March 14, 2011, 03:10:07 PM
That is HTML code. You should put it in an HTML block.
SimplePortal 2.3.8 © 2008-2024, SimplePortal