
esoteric
Members-
Posts
104 -
Joined
-
Last visited
Never
Everything posted by esoteric
-
finally got it to move but it just appears in the same directory as my script and it is named whatever filename i give so for example the file would then be called "$filename"
-
Warning: rename(../edit/news/news/test2.txt,../edit/news/archives/) [function.rename]: Not a directory in /xxxxx/xxxxx/xxxxx/xxxxx/xxxxx/admin/control/listnews.php on line 56
-
I tried what you guys said but nothing, when i try to echo the value it does nothing (cant delete or move), it keeps putting out an error on line 56 which is rename($value, "../edit/news/archives/$filename"); I tried many variation of this line but nothing solves it, any ideas?
-
Ok the following works to delete it but the problem im having is it wont move it too archive, Thing is there is a folder there, my folder my txt files are in is: 'website'/admin/edit/news/news/ and the archive folder is at 'website'/admin/edit/news/archive/ <form action='' method='post'> <table width="620" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td>Filename</td> <td>Archive</td> <td>Delete</td> </tr> <?php $path =('../edit/news/news/'); $dir = opendir('../edit/news/news/'); echo '<ul>'; while ($read = readdir($dir)) { if ($read!='.' && $read!='..') { echo '<li><a href="'.$path.$read.'">'.$read.'</a></li>'; } } echo '</ul>'; foreach(glob('../edit/news/news/*') as $file){ echo "<tr>"; echo "<td>$file</td>"; echo "<td><input type='checkbox' name='archive[]' value='$file' /> $file</td>"; echo "<td><input type='checkbox' name='delete[]' value='$file' /> $file</td>"; echo "</tr>"; } closedir($dir); ?> </table> <input type='hidden' name='submit'> <input type='submit'> </form> <?php // your authentication/log in check code would go here... if(isset($_POST['submit'])){ if(isset($_POST['delete']) && is_array($_POST['delete'])){ foreach($_POST['delete'] as $value){ if(file_exists($value)){ echo "Delete $value<br />"; unlink($value); }else{ echo "File Not Found $value; Did Not Delete<br />"; } } } if(isset($_POST['archive']) && is_array($_POST['archive'])){ foreach($_POST['archive'] as $value){ if(file_exists($value)){ echo "Archive $value<br />"; rename($value, "../edit/news/archives/$filename"); }else{ echo "File Not Found $value; Did Not Move<br />"; } } } } ?> The only other thing is can i have it display the file name as in 'test news article.txt' rather than the whole path ''../edit/news/news/test news article.txt'' Thanks again, i know its a pain help complete idiots out edit: forgot the mention that this script is in the location "'website'/admin/control/ "if that helps at all.
-
Thanks for all your replies, i have read through and tried each one without much luck, im still struggling to grasp php This is what i have, i check a checkbox and press submit query then i take me to a page to a '0' in the top left, but nothing happens teh file doesnt move or delete <table width="620" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="2">News Articles</td> </tr> <tr> <td width="140"> </td> <td width="480"> </td> </tr> <tr> <td align="center"> </td> <td align="center"> <?php $path = ('../edit/news/news/'); $dir = opendir('../edit/news/news/'); echo '<ul>'; while ($read = readdir($dir)) { if ($read!='.' && $read!='..') { ?> <form action="/admin/edit/news/process.php" method="post"> <table> <tr> <td>Filename <? echo "<a href='$path/$read'>$read</a>" ?></td> <td>Archive: <input type='checkbox' name='archive' value='$read'></td> <td>Delete: <input type='checkbox' name='delete' value='$read'></td> </tr> </table> <input type='hidden' name='submit'> <input type='submit'> </form> <? } } echo '</ul>'; closedir($dir); ?> </td> </tr> <tr> <td align="center"> </td> <td align="center"> </td> </tr> </table> Im guessing the page above is completely wrong?
-
So i take it that script would be the form action? How would the form look? i tried wrapping my php code in form tags but it didn't work Thanks for your patience
-
Your code works to add checkboxes, but i don't understand what you mean by this? Could you please explain? Thank you.
-
Hi guys, i have written this script to display all files in a folder, what to do is somehow turn this into a form or table with options to move the file to another folder. Basically its so i can move news article to a 'archive' folder other wise they all display on my page which before long is just too many and i have too delete them. so far i have <table width="620" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="2">News Articles</td> </tr> <tr> <td width="140"> </td> <td width="480"> </td> </tr> <tr> <td align="center"> </td> <td align="center"><?php $dir = opendir('../edit/news/news/'); echo '<ul>'; while ($read = readdir($dir)) { if ($read!='.' && $read!='..') { echo '<li><a href="../edit/news/news/'.$read.'">'.$read.'</a></li>'; } } echo '</ul>'; closedir($dir); ?></td> </tr> </table> Ideally it would be great if i had say a menu next to each file with the option to 'delete' or 'send to achive' thank you
-
This is where im at, been staring at this all day and can't get it too work, really appreciate any help. <?php $con = mysql_connect("XXX"); mysql_select_db("product_catalogue") or die( "Unable to select database"); if (!$con) { die('Could not connect: ' . mysql_error()); } $image = $_POST['image']; $link = $_POST['link']; $name = $_POST['name']; $id = $_POST['id']; $cat = $_POST['cat']; $version = $_POST['version']; $description = $_POST['decription']; $price = $_POST['price']; $shipping = $_POST['shipping']; if (!$id ) { die('Product ID is required!'); } else { $query = " UPDATE 'Products' SET 'ProductImage' = '".$ProductImage."', 'ProductLink' = '".$ProductLink."', 'ProductName' = '".$ProductLink."', 'Category' = '".$Category."', 'ProductVersion' = '".$ProductVersion."', 'ProductDescription' = '".$ProductDescription."', 'ProductPrice' = '".$ProductPrice."', 'ShippingPrice' = '".$ShippingPrice."' WHERE 'ProductId' = '".$ProductId."' "; echo " Update complete "; mysql_close($con); } ?>
-
I made a new form which send the inputs to this script <?php $con = mysql_connect("xxxxx", "xxxxxx", "xxxxxx"); if (!$con) { die('Could not connect: ' . mysql_error()); } $ProductImage = $_POST['ProductImage']; $ProductLink = $_POST['ProductLink']; $ProductName = $_POST['ProductName']; $ProductId = $_POST['ProductId']; $Category = $_POST['Category']; $ProductVersion = $_POST['ProductVersion']; $ProductDescription = $_POST['ProductDescription']; $ProductPrice = $_POST['ProductPrice']; $ShippingPrice = $_POST['ShippingPrice']; mysql_select_db("product_catalogue") or die( "Unable to select database"); mysql_query("UPDATE Products SET ( ProductImage, ProductLink, ProductName, ProductId, Category, ProductVersion, ProductDescription, ProductPrice, ShippingPrice ) VALUES ( '".$ProductImage."', '".$ProductLink."', '".$ProductName."', '".$ProductId."', '".$Category."', '".$ProductVersion."', '".$ProductDescription."', '".$ProductPrice."', '".$ShippingPrice."' WHERE ProductId = '".$ProductId."')"); echo " Update complete "; mysql_close($con); ?> But nothing is being updated. Any ideas?
-
I have the contents being listed now, i just need help on how to update each product, be great if i could someone click on the name and that brings up edit options? this is what i have so far. if (!mysql_connect($db_host, $db_user, $db_pwd)) die("Can't connect to database"); if (!mysql_select_db($database)) die("Can't select database"); $result = mysql_query("SELECT ID, ProductName, ProductId FROM {$table}"); if (!$result) { die("Query to show fields from table failed"); } $fields_num = mysql_num_fields($result); echo "<h1>Table: {$table}</h1>"; echo "<table border='0'><tr>"; for($i=0; $i<$fields_num; $i++) { $field = mysql_fetch_field($result); echo "<td>{$field->name}</td>"; } echo "</tr>\n"; while($row = mysql_fetch_row($result)) { echo "<tr>"; foreach($row as $cell) echo "<td>$cell</td>"; echo "</tr>\n"; } mysql_free_result($result); ?> Edit: Sorry we must have posted at the same time. I don't understand your meaning 'link the row id to a script' to be able to edit
-
Hi, sorry for asking so many questions but trying to get the 'admin' part of my site done. I have written a form which i can use to post new products to my database, all works fine. But is there anyway to browse products that are currently in there, like maybe a list or them all below the form which would allow me to see what i have instead of having to go through my web host each time? If the above is possible and could list my products say like; 1 - product 1 - £10 2 - product 2 - £17 etc... Could i then update these somehow? thanks in advance.
-
that gave me a syntax error, i tried a different way of writing it (and more simple) <? $error = ""; $pass = ($_POST['pass']); if (!isset($pass)){ echo "Please enter your password!"; } if ($pass != "test") { echo "Wrong Password"; } else { if ($pass == "test"); { $fn = "../../scripts/tabs_index/pages/news.html"; $content = stripslashes($_POST['content']); $fp = fopen($fn,"w") or die ("Error opening file in write mode!"); fputs($fp,$content); fclose($fp) or die ("Error closing file!"); echo "<div align='center'><h2>Change Successful!</h2></div>"; echo "<div align='center'>\n <p>News has been successfully changed and is now live!</p></div>"; echo "<div align='center'>\n---------------------------------------------------------------</div>"; echo "<meta http-equiv=\"refresh\" content=\"3; url=http://http://xxxxxxxx/account=administrator\" />\n"; } } ?> Which seems to be working. Thank you for you help.
-
Ops, thanks for the help. It doesn't seem to be checking the password is right though, i can type anything in and it still continues with the script, also how would i go about writing an error message if the wrong pass is entered? thank you.
-
Hi, i have written the script below but im trying to get to check a few things, one is if a variable i enter into the form (which is a password) exists and if not post an error message, if it does exist but i wrong, echo the password is wrong and if it does exist and is right then continue with the rest. For some reason at the moment it doesn't matter i type in a password or not, when hitting submit it just display the error message and the success message together <? $error = ""; $pass = ($_POST['pass']); if(!$pass) { $error .= "Please enter your password! "; } if($error){ echo "<div align='center'><h2>Error!</h2></div>"; echo "<div align='center'>\n<p>$error</p></div>"; echo "<div align='center'>\n</div>"; echo "<div align='center'>\n<p><a href='$HTTP_REFERER'>Return and try again</a></p></div>"; } if (!$error && $pass == 'test'); { $fn = "../../scripts/tabs_index/pages/news.html"; $content = stripslashes($_POST['content']); $fp = fopen($fn,"w") or die ("Error opening file in write mode!"); fputs($fp,$content); fclose($fp) or die ("Error closing file!"); echo "<div align='center'><h2>Change Successful!</h2></div>"; echo "<div align='center'>\n <p>News has been successfully changed and is now live!</p></div>"; echo "<div align='center'>\n---------------------------------------------------------------</div>"; echo "<meta http-equiv=\"refresh\" content=\"3; url=http://xxxxxxxxxxx/account=administrator\" />\n"; } ?> Thanks in advance.
-
would it be possible to give me an example please? None of my attempts are working, doesn't seem to do anything.
-
I'm asking for help, i been trying different things i found on the internet but none of them work or are too confusing to understand. Say the order number was typed in wrong then it would display ''Order Number not found'' If the order number exists but the username is wrong; '' Username incorrect'' If the order number exists but the password is wrong; ''Password incorrect'' Thanks for your patience.
-
That what im trying to do, i just need it to make sure the data the user enters in the form then exists in the sql database, if it doesn't then give an error instead of a blank page.
-
It a quite a large page but the start part is ..... $connection = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."<BR>"); mysql_select_db($dbname) or die (" Cannot find database"); $sql = "SELECT * FROM orderTable WHERE orderNum = '". $order ."' AND custUsername = '". $username ."' AND custPassword = '". $userpass ."'" or die ("Cannot find table"); $query = mysql_query($sql); while ($row = mysql_fetch_array($query)) { ?> <html> <head> .... If the 'custUsername', 'custPassword', or 'orderNum' is wrong i need it to display the error. Thanks
-
hi guys, this is probably simple but i couldn't find any posts about it. I have a form that displays some details if the right info has been typed in, if it's wrong info or if the fields have been left blank how can i display some sort of message like ''Invoice data could not be found, please check you details and try again'' At the moment, if you type the details in wrong it the page is just empty. thank you.
-
I cannot understand the problem with this script, im trying to have a invoice page that is updated with the information from my sql table depending on what the user types into a little form. My http form is just; <table width="400" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="52%" align="center">Order Number</td> <td width="48%"><input name="order" type="text" id="order" size="20" /></td> </tr> <tr> <td><p> </p></td> <td><p> <input name="button" type="submit" id="button" value="Submit" /> </p></td> </tr> </table> My php page is; <?php include 'dbc.php'; page_protect();?> <?php $order = $_POST['order']; mysql_connect("xxx", "xxx", "xxx") or die( "Unable to connect to database"); mysql_select_db("membership") or die( "Unable to select database"); $result = mysql_query("SELECT * FROM orderTable WHERE orderNum = '$order'"); $username = "test"; $password = "test"; if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) { ?> <h1>Login</h1> <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <p><label for="txtUsername">Username:</label> <br /><input type="text" title="Enter your Username" name="txtUsername" /></p> <p><label for="txtpassword">Password:</label> <br /><input type="password" title="Enter your password" name="txtPassword" /></p> <p><input type="submit" name="Submit" value="Login" /></p> </form> <?php } else { ?> <table width="50%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="29%">First Name</td> <td width="71%"><?php echo $result['firstName']; ?></td> </tr> <tr> <td>Lastname</td> <td><?php echo $result['lastName']; ?></td> </tr> <tr> <td>Order Number</td> <td><?php echo $result['orderNum']; ?></td> </tr> <tr> <td>Order Date</td> <td><?php echo $result['orderDate']; ?></td> </tr> <tr> <td>Order</td> <td><?php echo $result['strMessageBody']; ?></td> </tr> <tr> <td>Total</td> <td><?php echo $result['total']; ?></td> </tr> </table> <?php } ?> It just doesn't display anything! Any help is much appreciated. Thank you.
-
This is what i have but it doesn't matter what you type into the form to get your order, it just posts everything in the database to the screen <?php session_start(); mysql_connect("xxxxxxx", "xxxxxxxxx", "xxxxxxxxxx") or die( "Unable to connect to invoice database"); mysql_select_db("xxxxxxxxxx") or die( "Unable to select invoice database"); $surname = mysql_real_escape_string($_POST['surname']); $orderNum = mysql_real_escape_string($_POST['orderNum']); $check = mysql_query("SELECT * FROM orderTable WHERE orderNum = '{$orderNum}' & lastName = '{$surname}'")or die(mysql_error()); //Gives error if non-existent $check2 = mysql_num_rows($check); if ($check2 == 0) { echo "Incorrect Order Number or Surname, please try again."; die; } while ($data = mysql_fetch_assoc($check)) { ?> <html> <head> <title> <?php echo $data['lastName'];?> - Invoice </title> </head> <body> <table width="100%"> <tr> <td width="14%">First name</td> <td width="86%"> <input name="firstName" type="text" disabled="disabled" id="firstName" value="<?php echo $data['firstName'];?>" /> </td> </tr> <tr> <td>Lastname</td> <td><input name="lastName" type="text" disabled="disabled" id="lastName" value="<?php echo $data['lastName'];?>" /></td> </tr> <tr> <td>Order Number</td> <td><input name="orderDate" type="text" disabled="disabled" id="orderDate" value="<?php echo $data['orderNum'];?>" /></td> </tr> <tr> <td>Order Date</td> <td><input name="orderNum" type="text" disabled="disabled" id="orderNum" value="<?php echo $data['orderDate'];?>" /></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td>Order Details</td> <td><label for="textarea"></label> <textarea name="textarea" cols="65" rows="10" disabled="disabled" id="textarea"><?php echo $data['strMessageBody']; ?></textarea></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td>Total</td> <td><input name="total" type="text" id="total" value="<?php echo $data['total'];?>" readonly="readonly" /></td> </tr> </table> </body> </html> <? } ?>
-
That is just a test invoice, all the details are saved in my database after a customer sends me and order form. I sell products that are made too order so i have to read each invoice, i then email the customer there unique username and password which they can then use to log on and pay for there invoice. What happens is on my website there is a 'my account' page with this form <form name="form1" id="form1" method="post" action=""> <table width="400" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="52%" align="center"><p>Surname</p></td> <td width="48%"><p> <input name="surname" type="text" class="lowercase" id="surname" size="20" /> </p></td> </tr> <tr> <td align="center"><p>Order Number</p></td> <td><p> <input name="on" type="text" class="lowercase" id="on" size="20" /> </p></td> </tr> <tr> <td height="36" align="center"><p>Date</p></td> <td><p> <input name="date" type="text" class="lowercase" id="date" size="10"/> <span class="credit">example: 010111</span></p></td> </tr> <tr> <td><p> </p></td> <td><p> <input name="button" type="button" id="button" value="Submit" onclick="makeURL();" /> </p></td> </tr> </table> </form> When all the details are entered in it turns it into a url. I'm not struck on this method but its all i can figure out, i like your way better. I still don't understand how to make the page display the right details though, if i grab all the details how can i get the variable from the user for the right invoice? Wouldn't i need some sort of input box where the customer would type the invoice number? maybe just <table> <tr> <td>order number</td> <td><form name="form1" method="post" action=""> <label for="orderNum"></label> <input type="text" name="orderNum" id="orderNum"> </form></td> </tr> <tr> <td> </td> <td> <input type="submit" name="submit" id="submit" value="Submit"> </form> </td> </tr> </table> i don't know what the action would be though. That then takes you to the new page with the order number variable WHERE orderNum = '$_POST['userNum']' AND userId = '{$_SESSION['user_id']}' Is that right? If not i know im asking a lot but i would really appreciate if you could give me some sort of example to get me going. Thank you.
-
Oh i see what you mean so something like; <?php $invdata = mysql_query("SELECT * FROM Invoices WHERE AND `ID` = '{$ID}'") or die(mysql_error()); while ($data = mysql_fetch_assoc($invdata)) { echo $req['lastName'];, echo $req['firstName']; /n echo $req['orderDate']; /n echo $req['orderNum']; /n /n echo $req['strMessageBody']; /n echo $req['total']; } ?> or am i missing what you mean? also how would i include my login (the bit at the top of the code i posted) and payment script (the form near the bottom) for this? I suppose i would need a unique url for each invoice if you do it this way? but how would it display the data for the correct invoice? I don't understand how to have it display a specific invoice Thanks for the help so far
-
I really have no idea what function i can use to create a new page but i can post the actual page i want to use as a template? I been searching everywhere but can't find anything Here is the template page <?php include '../../login/dbc.php'; page_protect();?> <?php $ip = $_SERVER['REMOTE_ADDR']; $pagina = $_SERVER['REQUEST_URI']; $datum = date("d-m-y / H:i:s"); $invoegen = $datum . " - " . $ip . " - " . $pagina . "<br />"; $fopen = fopen("ref&surname=smith&on=10811134151&date=010811.html", "a"); fwrite($fopen, $invoegen); fclose($fopen); $username = "admin"; $password = "admin"; if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) { ?> <?php mysql_connect("xxxxxxxxxx", "xxxxxxxxxx", "xxxxxxxxxxxxxxx") or die( "Unable to connect to database"); mysql_select_db("xxxxxxxxxxxxx") or die( "Unable to select database"); $result = mysql_query("SELECT * FROM orderTable") ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>xxxxxxxxxxxx - Invoice</title> <link rel="stylesheet" href="../../css/gradient.css" /> <link rel="stylesheet" href="../../css/menu.css" /> <link rel="stylesheet" href="../../css/slider_style.css" /> <link rel="stylesheet" href="../../css/poll_styles.css" /> <link rel="stylesheet" href="../../css/style.css" /> <script language="javascript"> function confirm_log_in() { return confirm('By logging in, you agree the details above are correct'); } </script> <style type="text/css"> body { background-color: #DDEEF6; } </style> </head> <body> <table width="612" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center"><p><img src="../../images/catalogue/orderstatus_title.png" width="400" height="100" alt="order"><br> </p></td> </tr> <tr> <td align="center"><hr /></td> </tr> <tr> <td align="center"><table width="40%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="2"><?php // unique customer order number $sql="SELECT * FROM orderTable WHERE orderNum = '10811134151' AND userId = '{$_SESSION['user_id']}'"; if ($query=@mysql_query($sql)) { if (mysql_num_rows($query) > 0) { while ($req=mysql_fetch_array($query)) { ?></td> </tr> <tr> <td width="36%" bgcolor="#CDE3F3">Customer name</td> <td width="64%" align="center" bgcolor="#CDE3F3"><input name="textfield7" type="text" disabled="disabled" id="textfield7" value="<?php echo $req['lastName'];?>, <?php echo $req['firstName'];?>"></td> </tr> <tr> <td bgcolor="#CDE3F3">Order Date</td> <td align="center" bgcolor="#CDE3F3"><input name="textfield" type="text" disabled="disabled" id="textfield" value="<?php echo $req['orderDate']; ?> "/></td> </tr> <tr> <td bgcolor="#CDE3F3">Order Number</td> <td align="center" bgcolor="#CDE3F3"><input name="textfield8" type="text" disabled="disabled" id="textfield8" value="<?php echo $req['orderNum'];?>"></td> </tr> <tr> <td colspan="2"><span class="description"> <?php } } else { echo "Your Invoice could not be found! Please try again later."; } } else { echo "Query failed ".mysql_error(); } ?> </span></td> </tr> </table></td> </tr> <tr> <td align="center"><p class="loginform"><span class="errorMessage">If the above details are correct, enter your username and password below.<br> <a href="http://xxxxxxxxxxxxxx/account=account">Not you?</a> Please check your order number and try again. </span><br> <br> </p></td> </tr> <tr> <td align="center"><hr /></td> </tr> <tr> <td align="center"><form name="form" method="post" action="<?php echo $_SERVER['../../login/PHP_SELF']; ?>"> <p> <label for="txtUsername">Username:</label> <br /> <input type="text" title="Enter your Username" name="txtUsername" /> </p> <p> <label for="txtpassword">Password:</label> <br /> <input type="password" title="Enter your password" name="txtPassword" /> </p> <p> <input type="submit" onclick="confirm_log_in()" onclick="return log_in()" name="Submit" value="Login" /> </p> </form></td> </tr> <tr> <td align="center" class="credit">You should have received an email containing your username and password after your order has been processed. Please allow up to 24 hours after submitting your order to receive this email. Keep your details safe as you will need them each time you want to access this page.<br /> <br /> If you still have not received your details or cannot log in then please <a href="http://xxxxxxxxxxxxxxx/contact-us">contact us</a>. By clicking 'Login' you agree that you are the customer stated above or have permission from the customer. For security your IP address will be logged.</td> </tr> <tr> <td><hr /></td> </tr> <tr> <td><?php } else { ?></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr align="center"> <td><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td colspan="2" align="center"><p>Below you will find details regarding your order, please check everything is correct BEFORE you submit payment. If you need to amend anything please <a href="http://xxxxxxxxxxxxxx/contact-us">contact us</a><br> <br> <?php // unique customer order number $sql="SELECT * FROM orderTable WHERE orderNum = '10811134151' AND userId = '{$_SESSION['user_id']}'"; if ($query=@mysql_query($sql)) { if (mysql_num_rows($query) > 0) { while ($req=mysql_fetch_array($query)) { ?> </p></td> </tr> <tr> <td width="100%" colspan="2" align="center"><textarea name="textarea" id="textarea" cols="90" rows="20"><?php echo $req['strMessageBody']; ?></textarea> <br></td> </tr> <tr> <td colspan="2" align="center"><hr /></td> </tr> <tr> <td colspan="2" align="center"><br></td> </tr> <tr> <td colspan="2" align="center"><form id="form1" name="form1" method="post" action="http://xxxxxxxxxxxxxx/login/payment/Payment_Information.php"> <table width="60%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="240" align="center"><p>Total in GBP(£)</p></td> <td width="190"><input name="amount" type="text" id="amount" value="<?php echo $req['total'];?>" readonly="readonly" /></td> </tr> <tr> <td> </td> <td><label> <input type="submit" name="submit" id="submit" value="Submit" /> </label></td> </tr> </table> <br /> </form></td> </tr> <tr> <td colspan="2" align="center">To confirm invoice amount, please press the submit button above, once your payment has been received your order can begin to be built. <br /> <br /> </td> </tr> <tr> <td colspan="2" align="center"><span class="description"> <?php } } else { echo "Your Invoice could not be found! Please try again later."; } } else { echo "Query failed ".mysql_error(); } ?> </span></td> </tr> </table> <p> </p></td> </tr> </table></td> </tr> <tr> <td><?php } ?></td> </tr> </table> </body> </html> Any ideas to get me started?