SmileUK
30-01-2009, 04:22 PM
How come:
<form method='post' action='javascript:ajaxpage\(\'http://www.*****.com/staff/request.php?op=reg\'\,%20\'contentarea\'\)\;'>
doesn't work.
it's on a php page to make a form do what i've put there.
i take it i can't make a submit button do javascript?
or i've totally messed it up somewhere.
url blocked out btw.
Current full page:
<?
include "config.php";
include "front_page_stats.php";
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Request Line</title>
<style type="text/css">
body {background-color: transparent}
</style>
<link href="../css/staff.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="headn blue">Request & Shoutout Line</div>
Want to send a message to a DJ? Well here is the place to do so. Whether you've come to enter a competition, ask for a song or just want to say something that's on your mind, this is the form <em>you</em> need to fill in.<br />
Your IP is: <? $ip=$_SERVER['REMOTE_ADDR']; echo "<strong>$ip</strong>"; ?>. This is sent with the request for security issues.<br />
<?
if($_GET["op"] == "reg") {
//$result = mysql_query("SELECT * FROM `staff`");
//while($worked = mysql_fetch_array($result)) {
//$get_word = $worked['username'];
//if(preg_match("/$get_word/i", "$servertitle")) { $dj_name = "$get_word"; }
//}
$dj_name = addslashes($_POST["dj_name"]);
if($dj_name == "Choose One...") { echo "<br /><br /><strong>You need to select a DJ or No one will receive your message!</strong>"; exit; }
$habboname = $_POST["habboname"];
$message = $_POST["message"];
if($habboname == "") { echo "<br /><br /><strong>Please fill in your Habbo name.</strong><br />"; exit; }
$habboname = addslashes($_POST["habboname"]);
$request = addslashes($_POST["request"]);
$type = addslashes($_POST["type"]);
$ip = getenv("REMOTE_ADDR");
$date = date("d.m.y - H:i:s");
$query = mysql_query("INSERT INTO `requests` (`habboname`, `type`, `dj_name`, `message`, `ip`, `date`) VALUES('$habboname', '$type', '$dj_name', '$request', '$ip', '$date' )");
echo "<br /><br /><strong>Thank you <em>$habboname</em> for your <em>$type</em> stay tuned your message may appear soon!<META HTTP-EQUIV='Refresh' CONTENT='2;URL=request.php";
} else { echo "
<form method=\"get\" action=\"#\" onsubmit=\"javascript:ajaxpage('http://eachhabbo.com/staff/request.php?op=reg', 'contentarea'); return false;\">
<br /><br />Habbo Name:<br />
<input type='text' name='habboname' size='30'></font><br /><br />
Type:<br />
<select name='type'>
<option value='Request'>Request</option>
<option value='Shoutout'>Shoutout</option>
<option value='Joke'>Joke</option>
<option value='Other'>Other</option>
<option value='Comp'>Competition</option>
</select><br /><br />
Select A DJ:<br />
<select name='dj_name'>";
$result = mysql_query("SELECT * FROM `staff`");
while($worked = mysql_fetch_array($result)) {
$get_word = $worked['username'];
if(preg_match("/$get_word/i", "$servertitle")) { echo "<option value='$get_word' selected>DJ $get_word</option>"; }
else { echo "<option value='$get_word'>DJ $get_word</option>"; }
}
echo "</select><br /><br />
Your Message:<br />
<textarea rows='3' cols='35' type='text' name='request' class='button'></textarea><br /><br />
<input type='submit' name='submit' value='Send Your Message'>";}
?>
</body>
</html>
Also tried (and a few variations of these):
<form method="get" action="#" onsubmit="ajaxpage('http://www.*****.com/staff/request.php?op=reg', 'contentarea'); return false;">
<form method="post" onsubmit="javascript:ajaxpage('http://www.*****.com/staff/request.php?op=reg', 'contentarea');">
<form method='post' onsubmit='javascript:ajaxpage\(\'http://www.*****.com/staff/request.php?op=reg\'\,%20\'contentarea\'\)\;'>
<form method='post' action='javascript:ajaxpage\(\'http://www.*****.com/staff/request.php?op=reg\'\,%20\'contentarea\'\)\;'>
doesn't work.
it's on a php page to make a form do what i've put there.
i take it i can't make a submit button do javascript?
or i've totally messed it up somewhere.
url blocked out btw.
Current full page:
<?
include "config.php";
include "front_page_stats.php";
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Request Line</title>
<style type="text/css">
body {background-color: transparent}
</style>
<link href="../css/staff.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="headn blue">Request & Shoutout Line</div>
Want to send a message to a DJ? Well here is the place to do so. Whether you've come to enter a competition, ask for a song or just want to say something that's on your mind, this is the form <em>you</em> need to fill in.<br />
Your IP is: <? $ip=$_SERVER['REMOTE_ADDR']; echo "<strong>$ip</strong>"; ?>. This is sent with the request for security issues.<br />
<?
if($_GET["op"] == "reg") {
//$result = mysql_query("SELECT * FROM `staff`");
//while($worked = mysql_fetch_array($result)) {
//$get_word = $worked['username'];
//if(preg_match("/$get_word/i", "$servertitle")) { $dj_name = "$get_word"; }
//}
$dj_name = addslashes($_POST["dj_name"]);
if($dj_name == "Choose One...") { echo "<br /><br /><strong>You need to select a DJ or No one will receive your message!</strong>"; exit; }
$habboname = $_POST["habboname"];
$message = $_POST["message"];
if($habboname == "") { echo "<br /><br /><strong>Please fill in your Habbo name.</strong><br />"; exit; }
$habboname = addslashes($_POST["habboname"]);
$request = addslashes($_POST["request"]);
$type = addslashes($_POST["type"]);
$ip = getenv("REMOTE_ADDR");
$date = date("d.m.y - H:i:s");
$query = mysql_query("INSERT INTO `requests` (`habboname`, `type`, `dj_name`, `message`, `ip`, `date`) VALUES('$habboname', '$type', '$dj_name', '$request', '$ip', '$date' )");
echo "<br /><br /><strong>Thank you <em>$habboname</em> for your <em>$type</em> stay tuned your message may appear soon!<META HTTP-EQUIV='Refresh' CONTENT='2;URL=request.php";
} else { echo "
<form method=\"get\" action=\"#\" onsubmit=\"javascript:ajaxpage('http://eachhabbo.com/staff/request.php?op=reg', 'contentarea'); return false;\">
<br /><br />Habbo Name:<br />
<input type='text' name='habboname' size='30'></font><br /><br />
Type:<br />
<select name='type'>
<option value='Request'>Request</option>
<option value='Shoutout'>Shoutout</option>
<option value='Joke'>Joke</option>
<option value='Other'>Other</option>
<option value='Comp'>Competition</option>
</select><br /><br />
Select A DJ:<br />
<select name='dj_name'>";
$result = mysql_query("SELECT * FROM `staff`");
while($worked = mysql_fetch_array($result)) {
$get_word = $worked['username'];
if(preg_match("/$get_word/i", "$servertitle")) { echo "<option value='$get_word' selected>DJ $get_word</option>"; }
else { echo "<option value='$get_word'>DJ $get_word</option>"; }
}
echo "</select><br /><br />
Your Message:<br />
<textarea rows='3' cols='35' type='text' name='request' class='button'></textarea><br /><br />
<input type='submit' name='submit' value='Send Your Message'>";}
?>
</body>
</html>
Also tried (and a few variations of these):
<form method="get" action="#" onsubmit="ajaxpage('http://www.*****.com/staff/request.php?op=reg', 'contentarea'); return false;">
<form method="post" onsubmit="javascript:ajaxpage('http://www.*****.com/staff/request.php?op=reg', 'contentarea');">
<form method='post' onsubmit='javascript:ajaxpage\(\'http://www.*****.com/staff/request.php?op=reg\'\,%20\'contentarea\'\)\;'>