<?
# Start Session
session_start();
echo '<h1>Welcome';
# Get Variables
$firstName = (isset($_SESSION['first_name'])) ? $_SESSION['first_name'] : '';
$ad = (isset($_SESSION['ad'])) ? $_SESSION['ad'] : '';
$pcode = (isset($_SESSION['pcode'])) ? $_SESSION['pcode'] : '';
$phone = (isset($_SESSION['phone'])) ? $_SESSION['phone'] : '';
# Build Output
if(!empty($firstName) && !empty($ad) && !empty($pcode) && !empty($phone)) {
echo ", {$_SESSION['first_name']}!";
}
echo '</h1>';
// get lessson id
$event_id = $_GET['id'];
//echo $event_id;
if (!empty($event_id)) { $_SESSION['recordId']=$event_id; }
else { $event_id = $_SESSION['recordId']; }
if (empty($event_id) || isset($_POST['cancel'])) {
die('here1');
Header("Location: editbook.php");
exit;
}
$var1 = $_GET["username"];
$var2 = $_GET["password"];
$var3 = $_GET["destination"];
$var4 = $_GET["message"];
$var4 = urlencode($var4);
if( strlen( $var4 ) > 1)
{
echo "url:<BR>";
$url = ("
http://gw1.aql.com/sms/sms_gw.php?username=" . $var1 . "&password=" . $var2 . "&destination=" . $var3 . "&message=" . $var4 );
echo $url;
$handle = fopen( $url,'r' );
$response = fread($handle,1024);
echo "response:<BR>";
echo $response;
fclose($handle);
}
//echo "id".$event_id;
require_once("config.php");
$db_connection = mysql_connect ($DBHost, $DBUser, $DBPass) OR die (mysql_error());
$db_select = mysql_select_db ($DBName) or die (mysql_error());
$db_table = $TBL_PR . "calendar_event";
$query = "SELECT * FROM $db_table WHERE event_id='$_GET[id]' LIMIT 1";
$query_result = mysql_query ($query);
while ($info = mysql_fetch_array($query_result)){
$date = date ("l, jS F Y", mktime(0,0,0,$info['event_month'],$info['event_day'],$info['event_year']));
$time_array = split(":", $info['event_time']);
$time = date ("g:ia", mktime($time_array['0'],$time_array['1'],0,$info['event_month'],$info['event_day'],$info['event_year']));
echo $event_title;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>PHPCalendar - <? echo $info['event_title']; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="cal.css" rel="stylesheet" type="text/css"></head>
<body>
<table width="400" height="50" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="100">
<table width="480" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><span class="eventwhen"><u><? echo $date . " at " . $time; ?></u></span><br>
<br> <br> </td>
</tr>
<tr>
<td><span class="event">Lesson Reference</span></td>
</tr>
<tr>
<td><span class="eventslot"><? echo $info['slot_id']; ?></span><br></td>
</tr>
<tr>
<td><span class="event">Lesson Time</span></td>
</tr>
<tr>
<td><span class="eventtime"><? echo $info['event_time']; ?></span><br></td>
</tr>
<tr>
<td><span class="event">Subject Title</span></td>
</tr>
<tr>
<td><span class="eventdetail"><? echo $info['event_title']; ?></span><br>
<br></td>
</tr>
<td><span class="event">Lesson Status</span></td>
<tr>
<td><span class="eventstate"><? echo $info['status']; ?></span><br>
<br></td>
</tr>
</table></td>
</tr>
<tr>
<td><a href="clickcounter.php"> book</a></td>
</tr>
</table>
<FORM >
<div>
<INPUT TYPE=hidden NAME="username" VALUE="">
<INPUT TYPE=hidden NAME="password" VALUE="">
<INPUT TYPE=hidden NAME="destination" VALUE=""><BR>
Message:<BR>
<INPUT TYPE=hidden NAME="message" VALUE ="<?echo "Your Next Lesson is on".$date." at " . $time.".Your Instructor Will Be".$info['event_title'].$_SESSION['first_name']. $_SESSION['ad'].$_SESSION['pcode'].$_SESSION['phone']. "And Will Last Between".$info['event_time']. ". IF You Wish To Cancel Lesson Please Contact The School, Stating The Following Lesson Reference Number :".$info['slot_id'];?>">
<input type="hidden" name="link" value="">
<a href="clickcounter.php" onClick="document.forms[0].link.value='Book';doucment.forms[0].submit()">Book</a>
<input type="submit"value="Book"/>
</div>
</FORM>
</body>
</html>
<? }
?>
does not work im tryin to echo the first name session on screen then imput the other sessions in a SMS input form here:
"<INPUT TYPE=hidden NAME="message" VALUE ="<?echo "Your Next Lesson is on".$date." at " . $time.".Your Instructor Will Be".$info['event_title'].$_SESSION['first_name']. $_SESSION['ad'].$_SESSION['pcode'].$_SESSION['phone']. "And Will Last Between".$info['event_time']. ". IF You Wish To Cancel Lesson Please Contact The School, Stating The Following Lesson Reference Number :".$info['slot_id'];?>">"
how can i do i realy need this to work im working on my uni project, so it has to work some1 help
