Jump to content

thelee

Members
  • Posts

    60
  • Joined

  • Last visited

Everything posted by thelee

  1. how can i do the price calculation server-side ? can someone teach me please
  2. hello.sorry im quite noob in js, the calculation result is including js,so i do not know how to put the calculation result into database,can someone help me,here is the coding <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> <title>Cake Form</title> <script type="text/javascript" src="js/formcalculations.js"></script> <link href="styles/cakeform.css" rel="stylesheet" type="text/css" /> </head> <body onload='hideTotal()'> <div id="wrap"> <form action="" id="cakeform" onsubmit="return false;"> <div> <div class="cont_order"> <fieldset> <legend>Make your cake!</legend> <label >Size Of the Cake</label> <label class='radiolabel'><input type="radio" name="selectedcake" value="Round6" onclick="calculateTotal()" />Round cake 6" - serves 8 people ($20)</label><br/> <label class='radiolabel'><input type="radio" name="selectedcake" value="Round8" onclick="calculateTotal()" /> Kancil 60 </label> <br/> <label class='radiolabel'><input type="radio" name="selectedcake" value="Round10" onclick="calculateTotal()" /> Waja 100 </label> <br/> <label class='radiolabel'><input type="radio" name="selectedcake" value="Round12" onclick="calculateTotal()" /> </label> Ferrari 1000 <br/> <br/> <label ></label> <select id="filling" name='filling' onchange="calculateTotal()"> <option value="None">Select Filling</option> <option value="1">1 Day</option> <option value="2">2 Days</option> <option value="3">3 Days</option> <option value="4">4 Days</option> <option value="Raspberry">Raspberry($10)</option> <option value="Pineapple">Pineapple($5)</option> <option value="Dobash">Dobash($9)</option> <option value="Mint">Mint($5)</option> <option value="Cherry">Cherry($5)</option> <option value="Apricot">Apricot($</option> <option value="Buttercream">Buttercream($7)</option> <option value="Chocolate Mousse">Chocolate Mousse($12)</option> </select> <br/> <p> <label for='includecandles' class="inlinelabel"> </label> </p> <p> <label class="inlinelabel" for='includeinscription'></label> </p> <div id="totalPrice"></div> </fieldset> </div> <div class="cont_details"> <fieldset> <legend>Contact Details</legend> <label for='name'>Name</label> <input type="text" id="name" name='name' /> <br/> <label for='address'>Address</label> <input type="text" id="address" name='address' /> <br/> <label for='phonenumber'>Phone Number</label> <input type="text" id="phonenumber" name='phonenumber'/> <br/> </fieldset> </div> <input type='submit' id='submit' value='Submit' onclick="calculateTotal()" /> </div> </form> </div><!--End of wrap--> </body> </html> //Set up an associative array //The keys represent the size of the cake //The values represent the cost of the cake i.e A 10" cake cost's $35 var cake_prices = new Array(); cake_prices["Round6"]=20; cake_prices["Round8"]=60; cake_prices["Round10"]=100; cake_prices["Round12"]=1000; //Set up an associative array //The keys represent the filling type //The value represents the cost of the filling i.e. Lemon filling is $5,Dobash filling is $9 //We use this this array when the user selects a filling from the form var filling_prices= new Array(); filling_prices["None"]=0; filling_prices["1"]=1; filling_prices["2"]=2; filling_prices["3"]=3; filling_prices["4"]=4; filling_prices["Raspberry"]=10; filling_prices["Pineapple"]=5; filling_prices["Dobash"]=9; filling_prices["Mint"]=5; filling_prices["Cherry"]=5; filling_prices["Apricot"]=8; filling_prices["Buttercream"]=7; filling_prices["Chocolate Mousse"]=12; // getCakeSizePrice() finds the price based on the size of the cake. // Here, we need to take user's the selection from radio button selection function getCakeSizePrice() { var cakeSizePrice=0; //Get a reference to the form id="cakeform" var theForm = document.forms["cakeform"]; //Get a reference to the cake the user Chooses name=selectedCake": var selectedCake = theForm.elements["selectedcake"]; //Here since there are 4 radio buttons selectedCake.length = 4 //We loop through each radio buttons for(var i = 0; i < selectedCake.length; i++) { //if the radio button is checked if(selectedCake[i].checked) { //we set cakeSizePrice to the value of the selected radio button //i.e. if the user choose the 8" cake we set it to 25 //by using the cake_prices array //We get the selected Items value //For example cake_prices["Round8".value]" cakeSizePrice = cake_prices[selectedCake[i].value]; //If we get a match then we break out of this loop //No reason to continue if we get a match break; } } //We return the cakeSizePrice return cakeSizePrice; } //This function finds the filling price based on the //drop down selection function getFillingPrice() { var cakeFillingPrice=0; //Get a reference to the form id="cakeform" var theForm = document.forms["cakeform"]; //Get a reference to the select id="filling" var selectedFilling = theForm.elements["filling"]; //set cakeFilling Price equal to value user chose //For example filling_prices["Lemon".value] would be equal to 5 cakeFillingPrice = filling_prices[selectedFilling.value]; //finally we return cakeFillingPrice return cakeFillingPrice; } //candlesPrice() finds the candles price based on a check box selection function candlesPrice() { var candlePrice=0; //Get a reference to the form id="cakeform" var theForm = document.forms["cakeform"]; //Get a reference to the checkbox id="includecandles" var includeCandles = theForm.elements["includecandles"]; //If they checked the box set candlePrice to 5 if(includeCandles.checked==true) { candlePrice=5; } //finally we return the candlePrice return candlePrice; } function insciptionPrice() { //This local variable will be used to decide whether or not to charge for the inscription //If the user checked the box this value will be 20 //otherwise it will remain at 0 var inscriptionPrice=0; //Get a refernce to the form id="cakeform" var theForm = document.forms["cakeform"]; //Get a reference to the checkbox id="includeinscription" var includeInscription = theForm.elements["includeinscription"]; //If they checked the box set inscriptionPrice to 20 if(includeInscription.checked==true){ inscriptionPrice=20; } //finally we return the inscriptionPrice return inscriptionPrice; } function calculateTotal() { //Here we get the total price by calling our function //Each function returns a number so by calling them we add the values they return together var cakePrice = getCakeSizePrice() * getFillingPrice() ; //display the result var divobj = document.getElementById('totalPrice'); divobj.style.display='block'; divobj.innerHTML = "Total Price $"+cakePrice; } function hideTotal() { var divobj = document.getElementById('totalPrice'); divobj.style.display='none'; } #wrap{ width:400px; margin:0 auto; text-align:left; margin-top:8px; padding:5px; background:#fff; font-family:AvenirLTStd, Arial, Helvetica, sans-serif; font-size:13px; line-height:16px; } #wrap .cont_details fieldset,.cont_order fieldset{ margin:10px; padding:20px; -moz-border-radius: 10px; -webkit-border-radius: 10px; -khtml-border-radius: 10px; border-radius: 10px; } #wrap legend{ font-size:16px; font-family:Georgia, "Times New Roman", Times, serif; color:#000; font-weight:bold; font-style:italic; padding-bottom:10px; } #wrap .cont_details input{ margin-bottom:10px; color:#000; } #wrap .input1:hover,.input1:active{ } #wrap label{ display:block; font-size:12px; color:#000; font-weight:bold; } #wrap label.inlinelabel { display:inline; } #wrap .cont_order input{ margin-bottom:5px; } #wrap .cont_order p{ padding-top:5px; } #wrap input[type="radio"] { margin-top:8px; margin-bottom:8px; } #wrap input[type="text"]:hover, #wrap input[type="text"]:active { background-color: #FAF398; } #wrap input#submit { margin:10px; padding-left:20px; padding-right:20px; padding-top:10px; padding-bottom:10px; } #wrap div#totalPrice { padding:10px; font-weight:bold; background-color:#ff0; } #wrap label.radiolabel { font-weight:normal; display:inline; }
  3. sorry.im still noob. the day month year table is a date for appointment date because i'm using list view form for it. the month value in list form is january, february and so on. year is 2000,2001,2003 and so on and day is 1,2,3,4 and so on. admission_price is the total price of the services. i want to to build the graph based on month and admission_price
  4. here is my table structure. CREATE TABLE `boooking` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(30) NOT NULL, `address` varchar(50) NOT NULL, `phone` int(20) NOT NULL, `ic` varchar(20) NOT NULL, `email` varchar(20) NOT NULL, `plate` varchar(20) NOT NULL, `day` varchar(10) NOT NULL, `month` varchar(10) NOT NULL, `years` varchar(10) NOT NULL, `washtime` varchar(20) NOT NULL, `wash` int(20) NOT NULL, `normalpolish` varchar(20) NOT NULL, `specialpolish` varchar(20) NOT NULL, `wax` varchar(20) NOT NULL, `vacuum` varchar(20) NOT NULL, `admission_price` varchar(20) NOT NULL, `referenceno` varchar(20) NOT NULL, `time` varchar(20) NOT NULL, `date` varchar(20) NOT NULL,
  5. im using this code to show total sales based on each month <?php include("bookingconnect.php"); $sql="SELECT * FROM `boooking`"; $result=mysql_query($sql) or die("Cannot execute sql."); $query = "SELECT month, SUM(admission_price) FROM boooking GROUP BY month"; $result = mysql_query($query) or die(mysql_error()); // Print out result while($row = mysql_fetch_array($result)){ echo "Total ". $row['month']. " = RM ". $row['SUM(admission_price)']; echo "<br />"; } ?> and i have found a coding to build a graph. here is it <?php # ------- The graph values in the form of associative array $values=array( "Jan" => 120, "Feb" => 130, "Mar" => 215, "Apr" => 81, "May" => 310, "Jun" => 110, "Jul" => 190, "Aug" => 175, "Sep" => 390, "Oct" => 286, "Nov" => 150, "Dec" => 196 ); $img_width=450; $img_height=300; $margins=20; # ---- Find the size of graph by substracting the size of borders $graph_width=$img_width - $margins * 2; $graph_height=$img_height - $margins * 2; $img=imagecreate($img_width,$img_height); $bar_width=20; $total_bars=count($values); $gap= ($graph_width- $total_bars * $bar_width ) / ($total_bars +1); # ------- Define Colors ---------------- $bar_color=imagecolorallocate($img,0,64,128); $background_color=imagecolorallocate($img,240,240,255); $border_color=imagecolorallocate($img,200,200,200); $line_color=imagecolorallocate($img,220,220,220); # ------ Create the border around the graph ------ imagefilledrectangle($img,1,1,$img_width-2,$img_height-2,$border_color); imagefilledrectangle($img,$margins,$margins,$img_width-1-$margins,$img_height-1-$margins,$background_color); # ------- Max value is required to adjust the scale ------- $max_value=max($values); $ratio= $graph_height/$max_value; # -------- Create scale and draw horizontal lines -------- $horizontal_lines=20; $horizontal_gap=$graph_height/$horizontal_lines; for($i=1;$i<=$horizontal_lines;$i++){ $y=$img_height - $margins - $horizontal_gap * $i ; imageline($img,$margins,$y,$img_width-$margins,$y,$line_color); $v=intval($horizontal_gap * $i /$ratio); imagestring($img,0,5,$y-5,$v,$bar_color); } # ----------- Draw the bars here ------ for($i=0;$i< $total_bars; $i++){ # ------ Extract key and value pair from the current pointer position list($key,$value)=each($values); $x1= $margins + $gap + $i * ($gap+$bar_width) ; $x2= $x1 + $bar_width; $y1=$margins +$graph_height- intval($value * $ratio) ; $y2=$img_height-$margins; imagestring($img,0,$x1+3,$y1-10,$value,$bar_color); imagestring($img,0,$x1+3,$img_height-15,$key,$bar_color); imagefilledrectangle($img,$x1,$y1,$x2,$y2,$bar_color); } header("Content-type:image/png"); imagepng($img); ?> can anyone help me, how to make the graph value based on the total sales for each month ?
  6. currently im using this coding to calculate total price.but i need to submit 1st then it will show the result.how can i make it automatically show the result without press the submit button ? <?php $dollars = 0; // If the user post the form if(isset($_POST['value'])) { foreach ($_POST['product'] as $product) { if(is_numeric($product) && $product >= 0) { $dollars += $product; } } } ?> <!DOCTYPE HTML> <html> <head></head> <body> <form method="post"> <label><input type="checkbox" name="product[]" value="100" /> 100</label><br/> <label><input type="checkbox" name="product[]" value="250" /> 250</label><br/> <label><input type="checkbox" name="product[]" value="350" /> 350</label><br/> <label><input type="checkbox" name="product[]" value="20" /> 20</label><br/> <label><input type="checkbox" name="product[]" value="25" /> 25</label><br/> <input type="submit" name="value" /> </form> <p>Product : RM <input name="textfield" type="text" value="<?php echo $dollars; ?>"> </p> </body> </html>
  7. hellow. i found a coding at http://jsfiddle.net/Pw2Pp/ i think i want to use it at booking form. can someone tell me how to implement it ? i really do not know how to use it.help plz
  8. can someone help me.the username box can show the session username.how i can auto fill the address part ? i use this code but got error at the address form. here is the code <?php error_reporting(E_ALL); session_start(); if(!isset($_SESSION['MM_Username'])) { echo "You are not logged in or registered / Click <a href='login.php'>Here</a> to login !"; } else { ?> <style type="text/css"> <!-- body { background:#000; background-attachment:fixed; background-repeat:no-repeat; color:#fff; font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; } table { background:#000; border:1px solid white;} --> </style> </head> <body> <p><b>Welcome <?PHP echo $_SESSION['MM_Username']; ?> !</b></p> <form name="form1" method="post" action="order_product_process.php"> <p align="center" class="style10"> </p> <p align="center" class="style10"> </p> <p align="center" class="style10"> </p> <p align="center" class="style10"> </p> <p align="center" class="style10">Order Form:</p> <div align="center"> <table width="500" > <tr> <td width="239">Username</td> <td width="249"> <input name="username" type="text" id="username" value="<?PHP echo $_SESSION['MM_Username']; ?>" readonly="true"></td> </tr> <tr> <td>Address</td> <td><textarea name="address" id="address" value="<?PHP echo $_SESSION['MM_address']; ?>></textarea></td> <td><input type="submit" name="Submit" value="Order"> <input name="Reset" type="reset" id="Reset" value="Reset"></td> </tr> </table> </div> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </form> </body> </html> <?php } ?>
  9. CREATE TABLE `order` ( `order_id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(30) NOT NULL DEFAULT '', `address` varchar(30) NOT NULL DEFAULT '', `phone` varchar(30) NOT NULL DEFAULT '', `ic` varchar(30) NOT NULL DEFAULT '', `product_name` varchar(30) NOT NULL DEFAULT '', `quantity` int(30) NOT NULL DEFAULT '0', PRIMARY KEY (`order_id`) ) ENGINE=MyISAM AUTO_INCREMENT=27 DEFAULT CHARSET=latin1
  10. here is it the order table structure CREATE TABLE `order` ( `order_id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(30) NOT NULL DEFAULT '', `address` varchar(30) NOT NULL DEFAULT '', `phone` varchar(30) NOT NULL DEFAULT '', `ic` varchar(30) NOT NULL DEFAULT '', `product_name` varchar(30) NOT NULL DEFAULT '', `quantity` int(30) NOT NULL DEFAULT '0', PRIMARY KEY (`order_id`) ) ENGINE=MyISAM AUTO_INCREMENT=27 DEFAULT CHARSET=latin1
  11. i have create a table for customer to make order. but i do not know how i can build a customer order confirmation,which mean the page will show what is the customer name.ordered product and it will ask the customer to confirm to make the order or back to the order form back. here is the orderform <?php error_reporting(E_ALL); session_start(); if(!isset($_SESSION['MM_Username'])) { echo "You are not logged in or registered / Click <a href='login.php'>Here</a> to login !"; } else { ?> <style type="text/css"> <!-- body { background:#000; background-attachment:fixed; background-repeat:no-repeat; color:#fff; font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; } table { background:#000; border:1px solid white;} --> </style> </head> <body> <p><b>Welcome <?PHP echo $_SESSION['MM_Username']; ?> !</b></p> <form name="form1" method="post" action="order_product_process.php"> <p align="center" class="style10"> </p> <p align="center" class="style10"> </p> <p align="center" class="style10"> </p> <p align="center" class="style10"> </p> <p align="center" class="style10">Order Form:</p> <div align="center"> <table width="500" > <tr> <td width="239">Username</td> <td width="249"> <input name="username" type="text" id="username" value="<?PHP echo $_SESSION['MM_Username']; ?>" readonly="true"></td> </tr> <tr> <td>Address</td> <td><textarea name="address" id="address"></textarea></td> </tr> <tr> <td>Phone</td> <td><input name="phone" type="text" id="phone" maxlength="30"></td> </tr> <tr> <td>IC Number</td> <td><input name="ic" type="text" id="ic" maxlength="30"></td> </tr> <tr> <td>Product Name</td> <td><input name="product_name" type="text" id="product_name" maxlength="30"></td> </tr> <tr> <td>Quantity</td> <td> <input name="quantity" type="text" id="quantity" maxlength="30"></td> </tr> <tr> <td> </td> <td><input type="submit" name="Submit" value="Order"> <input name="Reset" type="reset" id="Reset" value="Reset"></td> </tr> </table> </div> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </form> </body> </html> <?php } ?> here is the orderconnect.php <? mysql_connect("localhost", "root", "") or die("Cannot connect to server."); mysql_select_db("order") or die("Cannot select database."); ?> can someone help me please
  12. ellow. how i can auto fill the form for address and else.i just know how to auto fill the username because it is using the echo from session login username.can someone help me ? here is the code <?php error_reporting(E_ALL); session_start(); if(!isset($_SESSION['MM_Username'])) { echo "You are not logged in or registered / Click <a href='login.php'>Here</a> to login !"; } else { ?>[/background][/size][/font][/color] [color=#464646][font='Helvetica Neue', Helvetica, Arial, sans-serif][size=3][background=rgb(244, 244, 244)]<style type="text/css"> <!-- body { background:#000; background-attachment:fixed; background-repeat:no-repeat; color:#fff; font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; } table { background:#000; border:1px solid white;} --> </style> </head>[/background][/size][/font][/color] [color=#464646][font='Helvetica Neue', Helvetica, Arial, sans-serif][size=3][background=rgb(244, 244, 244)]<body> <p><b>Welcome <?PHP echo $_SESSION['MM_Username']; ?> !</b></p> <form name="form1" method="post" action="order_product_process.php"> <p align="center" class="style10"> </p> <p align="center" class="style10"> </p> <p align="center" class="style10"> </p> <p align="center" class="style10"> </p> <p align="center" class="style10">Order Form:</p> <div align="center"> <table width="500" > <tr> <td width="239">Username</td> <td width="249"> <input name="username" type="text" id="username" value="<?PHP echo $_SESSION['MM_Username']; ?>" readonly="true"></td> </tr> <tr> <td>Address</td> <td><textarea name="address" id="address"></textarea></td> </tr> <tr> <td>Phone</td> <td><input name="phone" type="text" id="phone" maxlength="30"></td> </tr> <tr> <td>IC Number</td> <td><input name="ic" type="text" id="ic" maxlength="30"></td> </tr> <tr> <td>Product Name</td> <td><input name="product_name" type="text" id="product_name" maxlength="30"></td> </tr> <tr> <td>Quantity</td> <td> <input name="quantity" type="text" id="quantity" maxlength="30"></td> </tr> <tr> <td> </td> <td><input type="submit" name="Submit" value="Order"> <input name="Reset" type="reset" id="Reset" value="Reset"></td> </tr> </table> </div> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </form> </body> </html> <?php } ?>
  13. can u teach me how to do it,sorry im still new in php. i do the form with a help from my fren
  14. i have create a order form and the username is autofill based on the session login username.but i do not know how i can autofill the address.email .can someone help me ? here is the order form code <?php error_reporting(E_ALL); session_start(); if(!isset($_SESSION['MM_Username'])) { echo "You are not logged in or registered / Click <a href='login.php'>Here</a> to login !"; } else { ?> <style type="text/css"> <!-- body { background:#000; background-attachment:fixed; background-repeat:no-repeat; color:#fff; font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; } table { background:#000; border:1px solid white;} --> </style> </head> <body> <p><b>Welcome <?PHP echo $_SESSION['MM_Username']; ?> !</b></p> <form name="form1" method="post" action="order_product_process.php"> <p align="center" class="style10"> </p> <p align="center" class="style10"> </p> <p align="center" class="style10"> </p> <p align="center" class="style10"> </p> <p align="center" class="style10">Order Form:</p> <div align="center"> <table width="500" > <tr> <td width="239">Username</td> <td width="249"><?PHP echo $_SESSION['MM_Username']; ?></td> </tr> <tr> <td>Address</td> <td><textarea name="address" id="address"></textarea></td> </tr> <tr> <td>Phone</td> <td><input name="phone" type="text" id="phone" maxlength="30"></td> </tr> <tr> <td>IC Number</td> <td><input name="ic" type="text" id="ic" maxlength="30"></td> </tr> <tr> <td>Product Name</td> <td><input name="product_name" type="text" id="product_name" maxlength="30"></td> </tr> <tr> <td>Quantity</td> <td> <input name="quantity" type="text" id="quantity" maxlength="30"></td> </tr> <tr> <td> </td> <td><input type="submit" name="Submit" value="Order"> <input name="Reset" type="reset" id="Reset" value="Reset"></td> </tr> </table> </div> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </form> </body> </html> <?PHP } ?> CREATE TABLE `order` ( `order_id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(30) NOT NULL DEFAULT '', `address` varchar(30) NOT NULL DEFAULT '', `phone` varchar(30) NOT NULL DEFAULT '', `ic` varchar(30) NOT NULL DEFAULT '', `product_name` varchar(30) NOT NULL DEFAULT '', `quantity` int(30) NOT NULL DEFAULT '0', PRIMARY KEY (`order_id`) ) ENGINE=MyISAM AUTO_INCREMENT=20 DEFAULT CHARSET=latin1
  15. hellow.im using md5 password for register.but when at the login session,i dont know how i can read the md5 password to login back ? can someone help me.here is the login form <?php require_once('Connections/deli.php'); ?> <?php // *** Validate request to login to this site. session_start(); $loginFormAction = $_SERVER['PHP_SELF']; if (isset($accesscheck)) { $GLOBALS['PrevUrl'] = $accesscheck; session_register('PrevUrl'); } if (isset($_POST['username'])) { $loginUsername=$_POST['username']; $password=$_POST['password']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "home.php"; $MM_redirectLoginFailed = "index.php"; $MM_redirecttoReferrer = false; mysql_select_db($database_deli, $deli); $LoginRS__query=sprintf("SELECT username, password FROM users WHERE username='%s' AND password='%s'", get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password)); $LoginRS = mysql_query($LoginRS__query, $deli) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = ""; //declare two session variables and assign them $GLOBALS['MM_Username'] = $loginUsername; $GLOBALS['MM_UserGroup'] = $loginStrGroup; //register the session variables session_register("MM_Username"); session_register("MM_UserGroup"); if (isset($_SESSION['PrevUrl']) && false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } header("Location: " . $MM_redirectLoginSuccess ); } else { header("Location: ". $MM_redirectLoginFailed ); } } ?> </table> <style type="text/css"> <!-- .style9 {color: #FFFFFF} body { background-color: #FFFFFF; background-image: url(); } .style11 {font-size: 16px} .style14 {font-family: "Microsoft PhagsPa"} .style16 {color: #FFFFFF; font-weight: bold; } body,td,th { color: #FFFFFF; } --> </style> <table width="1139" border="1" align="center"> <tr> <td width="1129" height="164" bordercolor="#000000" background="wallpaper system.jpg" bgcolor="#FFFFFF"><div align="center"><img src="Deuter_Logo.jpg" width="243" height="214"></div></td> </tr> </table> <style type="text/css"> <!-- .style1 {color: #FFFFFF} body,td,th { color: #FFFFFF; } .style2 { font-size: xx-large; color: #000000; font-family: "Microsoft PhagsPa"; } .style8 {font-family: "Microsoft PhagsPa"; color: #FFFFFF; } a:link { color: #FFFFFF; text-decoration: none; } .style9 { font-family: "Microsoft PhagsPa"; color: #00FF00; } a:visited { color: #FFFFFF; text-decoration: none; } a:active { color: #FFFFFF; text-decoration: none; } a:hover { text-decoration: none; color: #FFFFFF; } body { background-color: #000000; } --> </style> <p align="center" class="style16 style22"><table width="357" border="0" align="center" bgcolor="#FFFFFF"> <tr> <td width="351" height="218" bordercolor="#000000" bgcolor="#000000"><form action='<?php echo $loginFormAction; ?>' method='POST'> <p align="center" class="style16 style22 style34 style9 style11 style14"><strong>deuter E-Shop</strong></p> <p align="center" class="style16 style22"><span class="style16 style23 style2 style9 style11 style14">We Provide High Quality Hiking Bag</span></p> <p> <p><span class="style8 style9 style14">Username: </span> <input type='username' name='username'> <p><br> <span class="style8 style9 style14">Password: </span> <input type='password' name='password'> <p> <br> <input type='submit' value='Log in'> <input type="reset" name="Submit2" value="Reset"> </form> <p class="style1"> <a href="register.php" class="style9 style14">click here to register</a></td> </tr> </table> <div align="center"> <p> </p> <table width="212" border="1" bgcolor="#000000"> <tr> <td width="230"><span class="style16"><a href="index_admin.php">ADMINISTRATION LOGIN</a> </span></td> </tr> </table> </div> <p align="center" class="style16 style23 style2"> <table width="1139" border="1" align="center"> <tr> <td width="1129" height="164" bordercolor="#000000" background="wallpaper system.jpg" bgcolor="#FFFFFF"> </td> </tr> </table>
  16. oh sorry.im still new with php. never heard about the heredoc.
  17. i want to make a order form but it is only for those who logged in. but i didnt show the form. i might do some mistake,can someone help me ? here is the code <?php session_start(); if(isset($_SESSION['MM_Username'])) { $MM_Username = $_SESSION['MM_Username']; echo "<body> <form name="form1" method="post" action="order_product_process.php"> <p align="center" class="style10"> </p> <p align="center" class="style10"> </p> <p align="center" class="style10"> </p> <p align="center" class="style10"> </p> <p align="center" class="style10">Order Form:</p> <div align="center"> <table width="249" border="1" bgcolor="#000000"> <tr> <td width="54"><span class="style1">Name</span></td> <td width="179"><input name="name" type="text" id="name" maxlength="30" value="<?php echo $MM_Username; ?>"></td> </tr> <tr> <td><span class="style4">Address</span></td> <td><textarea name="address" id="address"></textarea> </td> </tr> <tr> <td><span class="style1">Phone</span></td> <td><input name="phone" type="text" id="phone" maxlength="30"></td> </tr> <tr> <td><span class="style9">IC Number </span></td> <td><input name="ic" type="text" id="ic" maxlength="30"></td> </tr> <tr> <td><span class="style8">Product Name </span></td> <td><input name="product_name" type="text" id="product_name" maxlength="30"></td> </tr> <tr> <td><span class="style1">Quantity</span></td> <td> <input name="quantity" type="text" id="quantity" maxlength="30"></td> </tr> <tr> <td> </td> <td><input type="submit" name="Submit" value="Order"> <input name="Reset" type="reset" id="Reset" value="Reset"></td> </tr> </table> </div> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </form> </body>"; } else { $MM_Username = ''; echo "why you dont register?"; } ?> <style type="text/css"> body {background-attachment:fixed} body {background-repeat:no-repeat} --> </style> </head> </html>
  18. ok sorry.the problem solved.thanks a lot man.i love u muah !!! but im not gay !! muahhh
  19. omg.it doesnt work.the name form doesnt fill automatically. and it have some eror . =(
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.