PHP - Trouble With A Simple Comment Form
I'm trying to modify my existing comment form to only allow users to post comments. Right now anyone can visit the site and comment.
Here is my code if($_POST['submit']){ if($_POST['$_SESSION['username']))==''){ $err = "You must login first"; }elseif($_POST['thecomment']==''){ $err = "You have to enter a comment."; }else{ $username = strip_tags($_POST['username']); $themessage = strip_tags($_POST['thecomment']); $ezdb->get_results("INSERT INTO user_comments (id,date_added, posted_by, message, image_id) VALUE ('','".time()."','".$name."','".$themessage."','".$imageid."')"); $err = "Thank you for your comment."; } } When a user is logged in, I still get the "you must log in error" Help please. Similar TutorialsHi guys I'm trying to modify the following script so that only registered users can post comments. Can you guys help please thanks? <?php require_once("admin_common.php"); session_start(); if(is_numeric($_REQUEST['id'])){ $imageid = $_REQUEST['id']; }else{ header("Location: http://mysite.net/"); } if($_POST['submit']){ if($_POST['username']==''){ $err = "You must log in."; }elseif($_POST['thecomment']==''){ $err = "You have to enter a comment."; }else{ $name = strip_tags($_POST['thename']); $themessage = strip_tags($_POST['thecomment']); $ezdb->get_results("INSERT INTO user_comments (id,date_added, posted_by, message, image_id) VALUE ('','".time()."','".$name."','".$themessage."','".$imageid."')"); $err = "Thank you for your comment."; } } if($err){ $err = '<span style="color:#FF0000;">'.$err.'</span>'; } /* Update table `iid_ip`. Between the dashed lines is the create statement used to create the image view count (iid_ip) table. ---------------------------------------- delimiter $$ CREATE TABLE `iid_ip` ( `iid` int(11) unsigned NOT NULL COMMENT 'Image id from where the count is the number of unique views.', `ip` varchar(15) NOT NULL COMMENT 'The ip of the visitor.', PRIMARY KEY (`iid`), KEY `ip` (`ip`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Table for view count of image using unique ip''s.'$$ ---------------------------------------- */// Escape variables that are used in the query. $_ip = mysql_real_escape_string($_SERVER['REMOTE_ADDR']); $_iid = mysql_real_escape_string($imageid); // Count is 0 if ip has NOT seen the images, else count is 1 $_count = $ezdb->get_var("SELECT COUNT(*) FROM `iid_ip` WHERE `iid`='$_iid' AND `ip`='$_ip'"); if (!$_count) { // Insert the unique combination of image id and visitor ip in `iid_ip`. // Method doesn't exists! $ezdb->quick_insert('iid_ip', array('iid' => $_iid, 'ip' => $_ip)); $ezdb->get_results("INSERT INTO `iid_ip` (`iid`,`ip`) VALUES ('$_iid','$_ip')"); } // Get count of image views. $_views = $ezdb->get_var("SELECT COUNT(*) FROM `iid_ip` WHERE `iid`='$_iid'"); // And format, thousands seperator is a comma, no decimals. $_views = number_format($_views, 0, '', ','); ///////////////////////////// $page->addHTMLHead($scripthead); $d[] = "<div id='imagedetails'>"; $imgs = $ezdb->get_results("Select * From image_map Where id='".$imageid."'"); $name = $ezdb->get_var("Select name From `".$imgs[0]->obj_type."s` WHERE id ='".$imgs[0]->obj_id."'"); if($imgs[0]->obj_type=='comment') $pg='comm'; if($imgs[0]->obj_type=='image') $pg='img'; $d[] = "<a href='imagepage.php?".$pg."=".$imgs[0]->obj_id."' style='text-decoration:none;'>«".ucfirst($imgs[0]->obj_type)."s - $name</a><br /><br />"; // DEFINE SIMPLE GRID if ($imgs[0]->user_id != 0) { $theuser = $ezdb->get_var("SELECT username FROM users WHERE user_id='".$imgs[0]->user_id."'"); } else { $theuser = $imgs[0]->creator_name; } $d[]="<div style='float:left; width:450px; text-align:center;'> <a href='contact.php'><img src='assets/images/leftAdjpg'></a> <br /> <div style='font-size:12px; margin-top:30px; margin-left:5px;'> ".'Html Code: Use for websites, blogs, profiles and myspace.<br /><input name="textfield3" type="text" class="imagedetails_links" id="textfield3" onclick="this.select();this.focus()" value="<a href="http://www.mysite.net/imagedetails.php?id='.$imageid.'"><img src="http://www.mysite.net/uploads/'.$imgs[0]->link.'" border="0" alt=" " /></a><br /><a href="http://www.mysite.net"></a>" size="70" /> <br /> For posting in forums use this: <input name="textfield6" type="text" class="imagedetails_links" id="textfield6" onclick="this.select();this.focus()" value="[url=http://www.mysite.net][img]http://www.mysite.net/uploads/'.$imgs[0]->link.'[/img][/url]" size="70" /> <br /> </div> <div style="float:left; width:450px; margin-left:34px; margin-top:5px;"><table width="100" border="0"> <tr> <td class="widgets"><a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></td> <td class="widgets"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fmysite.net%2F&layout=box_count&show_faces=false&width=450&action=like&font=arial&colorscheme=light&height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:65px;" allowTransparency="true"></iframe></td> </tr> </table></div> '; if(ereg('.gif',$imgs[0]->link)){ $thelarge ="<img src='uploads/".$imgs[0]->link."' alt='".$imgs[0]->name."' style='border:0px solid #cccccc;' />"; }else{ $thelarge ="<img src='imageresize.php?imagepath=uploads/".$imgs[0]->link."&width=500&height=500' alt='".$imgs[0]->name."' style='border:0px solid #cccccc;' />"; } $d[]=" </div> <div style='float:left; margin-left:10px;'> <p style='padding:0; margin:0; margin-right:20px; text-align:center; font-size:14px;'><a href='force.php?path=uploads/".$imgs[0]->link."'>Click to Download Image</a></p><br /> ".$thelarge." <div style='overflow:auto; clear:both'> <div style='float:left; text-align: left;'> Image: <span style='color:#FFFFFF;'>{$imgs[0]->name}</span><br /> <span style='color:#ffffff; font-size:13px;'>Posted on: ".date('m-d-Y',$imgs[0]->date_added)." by ".ucfirst($theuser)."</span> </div> <div style='float:right'> <!-- Insert unique view count --> <span style='color:#ffffff; font-size:13px;'>Views: $_views</span> </div> </div> ".' </div> <div style="clear:both;"></div> <div style="margin:0 auto;"><br />'.$err.' <form action="'.$_SERVER['PHP_SELF'].'" method="post" style="margin:0 auto; width:400px; color:#ffffff; font-size:11px; text-align:left;"> <div style="margin-bottom:5px;">Leave a comment:</div><input type="hidden" name="id" value="'.$imageid.'" /> Your name: <input type="text" name="thename" style="width:250px;" class="inputfields" value="'.$_SESSION['username'].'"/><br /> Your comment:<br /><textarea name="thecomment" style="width:400px; height:70px;" cols="50" rows="4" class="textareas" ></textarea><br /> <input type="submit" name="submit" value="Post Comment" style="float:right;"/> </form> </div>'; $getallcomments = $ezdb->get_results("SELECT * FROM user_comments WHERE image_id='".$imageid."' ORDER BY date_added DESC"); $uclist = '<div style="margin:0 auto; width:410px; padding:5px; border:0px solid #cccccc; margin-top:40px;">'; if(sizeof($getallcomments)>0){ foreach ($getallcomments as $ac){ $uclist .='<div style="border-bottom:2px solid #333333; width:400px; color:#ffffff; font-size:12px; margin:0 auto; text-align:left;"><br />Posted on:<span style="color:#000000;"> '.date('m-d-Y',$ac->date_added).' at '.date('H:i a',$ac->date_added).'.</span><br />Posted by:<span style="color:#000000;"> '.strip_tags($ac->posted_by).'</span><br /><span style="color:#ffffff;">'.strip_tags($ac->message).'</span></div>'; } }else{ $uclist.='<div style="border-bottom:2px solid #ffffff; width:400px; color:#ffffff; font-size:12px; margin:0 auto; text-align:center;">Be the first to leave a comment!</div>'; } $uclist.="</div><div style='clear:both;'></div><br /><br />"; $d[] = $uclist."</div>"; $page->add($d); echo $page->render(); ?> (php is a weakness)
Here is the HTML portion for the form:
<form action="send_form_email.php" id="contacts-form" method="post"> CREATE TABLE posts ( postId INT(11) NOT NULL UNIQUE AUTO_INCREMENT, title VARCHAR(255) NOT NULL, author VARCHAR(24) NOT NULL, description TEXT NOT NULL, createdAt TIMESTAMP, PRIMARY KEY (postId) ); CREATE TABLE comments( commentId INT(11) NOT NULL UNIQUE AUTO_INCREMENT, comment TEXT NOT NULL, postId INT(11), userId INT(11), createdAt TIMESTAMP, PRIMARY KEY (commentId), FOREIGN KEY (userId) REFERENCES users(userId), FOREIGN KEY (postId) REFERENCES posts(postId) ); CREATE TABLE replies ( repId INT(11) NOT NULL UNIQUE AUTO_INCREMENT, reply TEXT NOT NULL, userId INT(11), commentId INT(11), createdAt TIMESTAMP, PRIMARY KEY (repId), FOREIGN KEY (userId) REFERENCES users(userId), FOREIGN KEY (commentId) REFERENCES comments(commentId) ); CREATE TABLE users ( userId INT(11) NOT NULL UNIQUE AUTO_INCREMENT, userName VARCHAR(100) NOT NULL,, email VARCHAR(100) NOT NULL, PRIMARY KEY (userId) ); how to retrive userName,comment, and createdAt from users and comments table while I have used userId as a Foreign key on the comment table if it isn't correct, correct me please I have a comment form that I have created. It gets the id from the database and prints out the data that goes with that id, but what it also does is prints out the information into the form. I want a blank form so that the user can add a comment to the record. Any ideas? This the code for the form: Code: [Select] <form method="post" action="pv.php?id=<?php echo $row['ID']?>&action=<?php echo $form_action ?>"> <fieldset> <legend></legend> <p> <label for="cname">Date Of Birth</label> * <input id="cname" name="dateofbirth" class="required date" value="<?php echo $row['Date_Of_Birth']?>" /> (eg 1978.11.11) </p> <p> <label for="cgender">Gender</label> * <input type="radio" name="gender" value="Male" <?php if($row['Gender']=='male'){echo 'checked';}?>/> Male <input type="radio" name="gender" value="Female" <?php if($row['Gender']=='female'){echo 'checked';}?>/> Female </td> </p> <p> <label for="curl">Title</label> * <select name="title" id="title" class="required"> <option value="">Please Select</option> <option value="Mr" <?php if($row['Title']=='Mr'){echo 'selected';}?>>Mr</option> <option value="Ms" <?php if($row['Title']=='Ms'){echo 'selected';}?>>Ms</option> <option value="Mrs" <?php if($row['Title']=='Mrs'){echo 'selected';}?>>Mrs</option> <option value="Miss" <?php if($row['Title']=='Miss'){echo 'selected';}?>>Miss</option> <option value="Other" <?php if($row['Title']=='Other'){echo 'selected';}?>>Other</option> </select> </p> <p> <label for="ccomment">First Name</label> * <input type="text" name="firstname" value="<?php echo $row['First_Name']?>" maxlength="50" /> </p> <p> <label for="cemail">Last Name</label> * <input id="cemail" type="text" name="lastname" value="<?php echo $row['Last_Name']?>" maxlength="75" /> </p> <p> <label for="ccomment">Address 1</label>* <input type="text" name="address1" value="<?php echo $row['Address_Line_1']?>" maxlength="50" /> </p> <p> <label for="ccomment">Address 2</label> <input type="text" name="address2" value="<?php echo $row['Address_Line_2']?>" maxlength="50" /> </p> <p> <label for="ccomment">City</label>* <input type="text" name="city" value="<?php echo $row['City']?>" maxlength="50" /> </p> <p> <label for="ccomment">Postcode</label>* <input type="text" name="postcode" value="<?php echo $row['Postcode']?>" maxlength= "10" /> (eg LE5 5QE) </p> <p> <label for="ccomment">Contact No</label>* <input type="text" name="contactno" value="<?php echo $row['Contact_No']?>" maxlength= "12" /> (eg 077448825723) </p> <p> <label for="ccomment">Email</label>* <input type="text" name="email" value="<?php echo $row['Email']?>" maxlength= "40"/> (eg info@example.com) </p> <p> <label for="ccomment">Comment</label> <textarea rows="10" cols="30" name="note" maxlength= "500"><?php echo $row['Additional_Comment']?></textarea> </p> <p> <input class="submit" type="submit" value="Submit"/> </p> <p> <a href='pv.php'>Main Page</a> </p> </fieldset> This is the code for printing out the data on the page: Code: [Select] if($_GET['action']=='comment'){ $form_action = 'comment_ok'; $id=$_GET['id']; $result = mysql_query("SELECT * FROM project_data WHERE id='$id'"); $row = mysql_fetch_array($result); echo'<b>'; echo $row['Date_Of_Birth']; echo '  '; echo $row['Gender']; echo '  '; echo $row['Title']; echo '  '; echo $row['First_Name']; echo '  '; echo $row['Last_Name']; echo '  '; echo $row['Address_Line_1']; echo '  '; echo $row['Address_Line_2']; echo '  '; echo $row['City']; echo '  '; echo $row['Postcode']; echo '  '; echo $row['Contact_No']; echo '  '; echo $row['Email']; echo '  '; echo $row['Additional_Comment']; echo '</b>'; } and a snippet of the code I am using to send the id to the form: Code: [Select] echo "<td><a href='pv.php?action=edit&id=" . $row['ID']."'>Edit</a>  <a href='pv.php?action=delete_ok&id=" . $row['ID']."'>Delete</a>  <a href='pv.php?action=comment&id=" . $row['ID']."'>Comment</a></td>"; echo "</tr>"; as far as everything goes, i have it working but not quite perfect yet... you may assume already what im trying to do, and yes im making a comment box option for each news posting I have. I have it working up to the point of showing comment posts and posting them. But my issue is, anytime i submit a comment for one news post, it will repeat the post for how many news postings i have and will place them in each news posting. so i need some help to prevent this lol. here's my code Code: [Select] <?php //News Code Here $dbtn = 'news'; $result = mysql_query("SELECT * FROM $dbtn ORDER by id DESC LIMIT 10") or die("query failed: " . msql_error()); while ($row = mysql_fetch_array($result)) { list($id, $header, $date, $news, $edate) = $row; $news = nl2br($news); $date = date("M j, Y",strtotime("$date")); echo '<table width="680" border="0" cellpadding="14" cellspacing="0">'; echo '<tr>'; echo '<td class="newspost">'; echo '<font size="+2"><b>'.$header.'</b></font><font size="-1" color="#CCCCCC"> - '.$date.'</font><br />'; echo '<hr color="#FFFFFF" width="100" align="left" size="1">'; echo ' - '.$news.$edate; echo '</td>'; echo '</tr>'; echo '<tr>'; echo '<td>'; $comres = mysql_query("SELECT * FROM comment WHERE menu_title='$dbtn' AND post_id='$id' ORDER by date DESC") or die("query failed: " . msql_error()); while($rows = mysql_fetch_array($comres)){ list($comid, $menu_title, $post_id, $comdate, $comname, $comment) = $rows; $comment = nl2br($comment); $comdate = date("M j, Y",strtotime("$comdate")); echo 'User: '.$comname.'<br />'; echo ' - '.$comment; echo '<div align="right"><font color="grey">'.$comdate.'</font></div>'; } echo '<a class="show_hide" rel="#slidingDiv_'.$id.'">Comment</a>'; echo '<div id="slidingDiv_'.$id.'" class="toggleDiv" style="display: none;">'; if(isset($_POST["add"])){ $name = $_POST["comname"]; $comment = $_POST["comment"]; $querys = "INSERT INTO comment (menu_title, post_id, date, name, comment) VALUES ('$dbtn', '$id', CURDATE(), '$name', '$comment')"; mysql_query($querys) or die("Error, insert query failed: ".mysql_error()); echo '<br /><br />Thank You!'; } else { echo '<form method="post">'; echo '<table width="100%" border="0" cellspacing="1" cellpadding="2">'; echo '<tr>'; echo '<td align="left" valign="top">Name</td>'; echo '<td align="left" valign="top">Comment</td>'; echo '</tr>'; echo '<tr>'; echo '<td align="left" valign="top"><input name="comname" size="25" type="text" id="comname"></td>'; echo '<td align="left" valign="top"><textarea name="comment" id="comment" cols="40" rows="4"></textarea></td>'; echo '</tr>'; echo '<tr>'; echo '<td> </td>'; echo '<td> </td>'; echo '</tr>'; echo '<tr>'; echo '<td> </td>'; echo '<td align="right" valign="top"><input name="add" type="submit" id="add" value="Submit"></td>'; echo '</tr>'; echo '</table>'; echo '</form>'; echo '</div>'; } echo '</td>'; echo '</tr>'; echo '</table>'; } ?> Hello everyone, I have a question with the use of the functon in_array... I have a list of categories in my table and I want to know if a specific category exists so I am doing this: $categoriasexistentes= mysql_query("SELECT * FROM LugaresTuristicos WHERE DestinoPeg='$LinkDestino' GROUP BY Clasificacion ") or die(mysql_error()); $array = mysql_fetch_array($categoriasexistentes); print_r($array); WHAT IS DISPLAYED BY print_r (there should be much more categories) IS THIS: Array ( => Bar [Clasificacion] => Bar ) If I ad this all categories are displayed: while($categoria = mysql_fetch_array($categoriasexistentes)) { $todas=$categoria['Clasificacion']; ?> <?php echo"{$todas} - "; ?> <?php }; ?> I'm just trying to incorporate some of what I've learned into practice and I can't believe I'm having problems with this but I really want to figure it out. I'm trying to create a simple program where a user enters the name of a song, and gives it a rating (out of 5), and it displays the output first by song rating then (if the ratings are the same) displays it by the name of the song alphabetically. The idea in practice would work like this...user enters: Quote Song Name: My Song Rating: 3 Song Name: His Song Rating: 5 Song Name: Her Song Rating: 5 Your list so far is: Her Song - 5 stars His Song - 5 stars My Song - 3 stars I just keep undoing things and clearly I'm not getting it. I had many ideas making it so I'll show you what I wrote (which isn't much): http://pastebin.com/2AGqgxQd It looks terrible I know, I was just trying to find out how to put things from the form INTO an array and trying to output the array as I described above. If I could figure out how to use these session arrays to hold the entries from the post, then I'd be able to sort them properly, I'm just lost right now because everything I've read online and tried wasn't fixing the problem. Thank you so much for the help! First time poster, and very amateur php coder. I am trying to delete items that in a list using ajax. I can't figure out what I am doing wrong. Any help would be greatly appreciated!
Here is a snippet of my javascript... $('.delete-item').click(function() { var itemID = $(this).data('itemID'); var clear = 1; $.ajax({ url: 'includes/delete-item.php', method: 'POST', data: { itemid:itemID, clear:1 }, success: function(data) { $('.content').load('includes/lists.php') } }) })
and here is the relevant php... $item = $_POST['itemid']; $clear = $_POST['clear']; $clearSQL = "DELETE FROM `List_Items` WHERE `item_ID` = $item"; $cleared = mysqli_query($connect, $clearSQL); This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=322815.0 I'm not sure if this is a php issue or jquery issue. When I complete the form and hit submit it puts the successful message up like its supposed to but also with the fields still filled in the form which it shouldn't be doing and it doesn't actually post in the database so I'm not sure if its a php issue or jquery issue. Code: [Select] <script type="text/javascript"> $(document).ready(function() { $('div.message-error').hide(); $('div.message-success').hide(); $("input.submit").click(function() { $('div.message-error').hide(); var templatename = $("input#templatename").val(); if (templatename == "") { $("div.message-error").show(); $("input#templatename").focus(); return false; } var headercode = $("textarea#headercode").val(); if (headercode == "") { $("div.message-error").show(); $("textarea#headercode").focus(); return false; } var footercode = $("textarea#footercode").val(); if (footercode == "") { $("div.message-error").show(); $("textarea#footercode").focus(); return false; } var dataString = 'templatename='+ templatename+ '&headercode=' + headercode + '&footercode=' + footercode; $.ajax({ type: "POST", url: "processes/template.php", data: dataString, success: function() { $("div.message-success").show(); return true; } }); return false; }); }); </script> <!-- Form --> <form action="#" name="templateform" > <fieldset> <legend>Add New Template</legend> <div class="field required"> <label for="templatename">Template Name</label> <input type="text" class="text" name="templatename" id="templatename" title="Template Name"/> <span class="required-icon tooltip" title="Required field - This field is required, it cannot be blank, and must contain something that is different from emptyness in order to be filled in. ">Required</span> </div> <div class="field required"> <label for="headercode">Header Code</label> <textarea name="headercode" id="headercode" title="Header Code"></textarea> <span class="required-icon tooltip" title="Required field - This field is required, it cannot be blank, and must contain something that is different from emptyness in order to be filled in. ">Required</span> </div> <div class="field required"> <label for="footercode">Footer Code</label> <textarea name="footercode" id="footercode" title="Footer Code"></textarea> <span class="required-icon tooltip" title="Required field - This field is required, it cannot be blank, and must contain something that is different from emptyness in order to be filled in. ">Required</span> </div> <input type="submit" class="submit" name="submittemplate" id="submittemplate" title="Submit Template" value="Submit Template"/> </fieldset> </form> <!-- /Form --> <!-- Messages --> <div class="message message-error"> <h6>Required field missing</h6> <p>Please fill in all required fields. </p> </div> <div class="message message-success"> <h6>Operation succesful</h6> <p>Template was added to the database.</p> </div> <!-- /Messages --> validation page <?php // Include the database page include ('inc/dbconfig.php'); if ((isset($_POST['templatename'])) && (strlen(trim($_POST['templatename'])) > 0)) { $templatename = stripslashes(strip_tags($_POST['templatename'])); } else {$templatename = 'No name entered';} if ((isset($_POST['headercode'])) && (strlen(trim($_POST['headercode'])) > 0)) { $headercode = stripslashes(strip_tags($_POST['headercode'])); } else {$headercode = 'No name entered';} if ((isset($_POST['footercode'])) && (strlen(trim($_POST['footercode'])) > 0)) { $footercode = stripslashes(strip_tags($_POST['footercode'])); } else {$footercode = 'No name entered';} $query = "INSERT INTO `templates` (templatename, header, footer, creator_id, datecreated) VALUES ('".$divisionname."','".$headercode."','".$footercode."' 1, NOW())"; mysql_query($query); ?> I'm not sure where the issue really lies after the form submits it DOES perform the error messages if there is one, however if the username and password are atleast filled in and the user clicks Log In it doesn't do anything after that. login.php <?php /** * @author Jeff Davidson * @copyright 2010 */ if (isset($_POST['submitted'])) { require_once ('inc/login_functions.php'); require_once ('inc/dbconfig.php'); list ($check, $data) = check_login($dbc, $_POST['username'], $_POST['password']); if ($check) { // OK! // Set the session data:. session_start(); $_SESSION['id'] = $data['id']; $_SESSION['firstname'] = $data['firstname']; // Redirect: $url = absolute_url ('loggedin.php'); header("Location: $url"); exit(); }else { // Unsuccessful! $errors = $data; } mysqli_close($dbc); } // End of the main submit conditional. include ('inc/login_page.php') ?> login_functions.php <?php /** * @author Jeff Davidson * @copyright 2010 */ // This page defines two functions used by the login/logout process. /* This function determines and returns an absolute URL. * It takes one argument: the page that concludes the URL. * The argument defaults to index.php. */ function absolute_url($page = 'index.php') { // Start defining the URL... // URL is http://plus the host name plus the current directory: $url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']); // Remove any trailing slashing: $url = rtrim($url, '/\\'); // Add the page $url .= '/' . $page; // Return the URL: return $url; } // End of absolute_url() function. /* This function validates the form data (the username and password). * If both are present, teh database is queried. * The function requires a database connection. * The function returns an array of information, including: * - a TRUE/FALSE variable indicating success * - an array of either errors or the database result */ function check_login($dbc, $username = '', $password = '') { $errors = array(); // Initialize error array. // Validate the username if (empty($username)) { $errors[] = 'You forgot to enter your username.'; } else { $u = mysqli_real_escape_string($dbc, trim($username)); } // Validate the password: if (empty($password)) { $errors[] = 'You forgot to enter your password.'; } else { $p = mysqli_real_escape_string($dbc, trim($password)); } if (empty($errors)) { // If everythings OK. // Retrieve the firstname and lastname for the username/password combination: $q = "SELECT id, firstname FROM users WHERE username='$u' AND password=SHA('$p')"; $r = @mysqli_query($dbc, $q); // Run teh query. // Check the result: if (mysqli_num_rows($r) == 1) { // Fetch the record: $row = mysqli_fetch_array($r, MYSQLI_ASSOC); // Return true and the record: return array(true, $row); }else { // Not a match! $errrors[] = 'The username and password entered do not match those on file.'; } } // End of empty ($errrors) IF. // Return false and the errors: return array(false, $errors); } //End of check_login() function. ?> login_page.php <?php /** * @author Jeff Davidson * @copyright 2010 */ // This page prints any errors associated with logging in and creates the login, including the form. // Prints any error messages, if they exists: if (!empty($errors)) { echo '<h1>Error!</h1> <p class="error">The following error(s) occured:<br />'; foreach ($errors as $msg) { echo " - $msg<br />\n"; } echo '</p><p>Please try again.</p>'; } // Display the form: ?> <!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" /> <meta name="description" content="Caracole" /> <title>Titanium</title> <link HREF="favicon.ico" type="image/x-icon" rel="icon" /> <link HREF="favicon.ico" type="image/x-icon" rel="shortcut icon" /> <link rel="stylesheet" type="text/css" href="css/tripoli.simple.css" media="screen, projection, print" /> <link rel="stylesheet" type="text/css" href="css/base.css" media="screen, projection, print" /> <link rel="stylesheet" type="text/css" href="css/layout.css" media="screen, projection, print" /> <link rel="stylesheet" type="text/css" href="css/style.css" media="screen, projection, print" /> <link rel="stylesheet" type="text/css" href="css/theme.css" media="screen, projection, print" /> <link rel="stylesheet" type="text/css" href="css/icons.css" media="screen, projection, print" /> <script type="text/javascript" SRC="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> //<![CDATA[ document.write('<link rel="stylesheet" type="text/css" href="css/js/js.css" media="screen, projection, print" />'); //]]> $(document).ready(function(){ $(".close").click(function(){ $(this).parents(".message").hide("puff"); }); }); </script> <!--[if IE]> <link rel="stylesheet" type="text/css" href="css/ie/ie.css" media="screen, projection, print" /> <![endif]--> <!--[if lt IE 7]> <script src="js/DD_belatedPNG_0.0.7a-min.js" type="text/javascript"></script> <script> DD_belatedPNG.fix(' #header, h1, h1 a, .close, .field,.paginate .current, .icon, .required-icon'); </script> <link rel="stylesheet" href="css/ie/ie6.css" type="text/css" media="screen, projection"/> <![endif]--> </head> <body> <!-- Content --> <div id="login" class="content"> <div class="roundedBorders login-box"> <!-- Title --> <div id="title" class="b2"> <h2>Log In</h2> <!-- TitleActions --> <div id="titleActions"> <div class="actionBlock"> <a href="#">Forgot your password ?</a> </div> </div> <!-- /TitleActions --> </div> <!-- Title --> <!-- Inner Content --> <div id="innerContent"> <form action="login.php" method="post"> <div class="field"> <label for="username">Username</label> <input type="text" class="text" id="username" name="username" /> </div> <div class="field"> <label for="password">Password</label> <input type="password" class="text" id="password" name="password"/> </div> <div class="clearfix login-submit"> <span class="fleft"> <input type="checkbox" name="remember-me" id="remember-me" /> <label for="remember-me">Remember me</label> </span> <span class="fright"> <button class="button" type="submit" name="submit"><strong>Log In</strong></button> </span> </div> <input type="hidden" value="TRUE" name="submitted" /> </form> </div> <!-- /Inner Content --> <div class="bBottom"><div></div></div> </div> </div> </body> </html> loggedin.php <?php /** * @author Jeff Davidson * @copyright 2010 */ // The user is redirected here from login.php. session_start(); // Star the session. // If no session value is present, redirect the user: if (!isset($_SESSION['id'])) { require_once('inc/login_functions.php'); $url = absolute_url(); header("Location: $url"); exit(); } $page_title = 'Logged In!'; // Print a customized message: echo "<h1>Logged In!</h1> <p>You are now logged in, {$_SESSION['firstname']}!</p> <p><a href=\"logout.php\">Logout</a></p>"; ?> I thought I'd come back in and insert the file manager I have setup here. root/loggedin.php root/login.php root/inc/login_page.php root/inc/login_functions.php Hi i'm new to PHP/web development but not new to coding. I have some php code that I grabed from a template where I am selecting data from a file and having it diplay on the screen in a form. My $query = "select * from file where" statement works and bring the data back to the screen. However, I want the data to be returned in a textarea instead of a text field that is not big enough to display the 3 paragraph that i need to display. Please see code below, thsi code will return the data but the text box only returns the data in a line, I need the data to be returned in a textarea, so I can update it. I have looked for the correct syntex with no luck, please correct me. $row = mysql_fetch_array($result, MYSQL_ASSOC); $recordid = $row['recordid']; $homepage = $row['homepage']; echo "<h2>Update About Us Information</h2>\n"; echo "<form enctype=\"multipart/form-data\" action=\"admin.php\" method=\"post\">\n"; echo "<table width=\"100%\" cellpadding=\"1\" border=\"1\">\n"; echo "<tr><td><h3>Record ID</h3></td><td>$recordid</td></tr>\n"; echo "<tr><td><h3>Homepage</h3></td><td><input type=\"text\" size=\"100\" name=\"homepage\" value=\"$homepage\" /></td></tr>\n"; echo "</table>\n"; echo "<input type=\"submit\" name=\"button\" value=\"Update\">\n"; echo "<input type=\"submit\" name=\"button\" value=\"Delete Product\">\n"; echo "</form>\n"; Hey guys, I have made an admin page for a game Im working on to quickly allow me to update many aspects of the game. My form is sending the correct data because i can echo the $_post but for some reason it isnt updating my database. I just get a blank white page. Could anyone see what i have done wrong. Thanks Code: [Select] <?php require($DOCUMENT_ROOT . "/game/includes/connection.php"); require($DOCUMENT_ROOT . "/game/includes/settings.php"); ?> <?php $name = $_POST['admin_name']; $img = $_POST['admin_img']; $current_hp = $_POST['admin_current_hp']; $max_hp = $_POST['admin_max_hp']; $current_energy = $_POST['admin_current_energy']; $max_energy = $_POST['admin_max_energy']; $level = $_POST['admin_level']; $exp_total = $_POST['admin_exp_total']; $exp = $_POST['admin_exp']; $exp_level = $_POST['admin_exp_level']; $pos_x = $_POST['admin_pos_x']; $pos_y = $_POST['admin_pos_y']; $potion = $_POST['admin_potion']; $ether = $_POST['admin_ether']; $elixir = $_POST['admin_elixir']; $zenni = $_POST['admin_zenni']; $sector = $_POST['admin_sector']; $battle = $_POST['admin_battle']; ?> <?php $sql_1 = "UPDATE game_character SET name='$name', img='$img', current_hp='$current_hp', max_hp='$max_hp', current energy='$current_energy', max_energy='$max_energy', level='$level', exp_total='$exp_total', exp='$exp', exp_level='$exp_level', pos_x='$pos_x', pos_y='$pos_y', potion='$potion', ether='$ether', elixir='$elixir', zenni='$zenni' WHERE id=1"; $sql_2 = "UPDATE game_status SET sector='$sector', battle='$battle' WHERE id=1"; $statement_1 = $dbh->prepare($sql_1); $statement_2 = $dbh->prepare($sql_2); $statement_1->execute(); $statement_2->execute(); ?> <SCRIPT LANGUAGE="JavaScript"> redirTime = "1"; redirURL = "<?php echo $r_admin ?>"; function redirTimer() { self.setTimeout("self.location.href = redirURL;",redirTime); } </script> <BODY onLoad="redirTimer()"> Hello! Everything on this form emails the way it should except for the checkboxes. The email simply states "Array" instead of what services are checked off. I don't understand PHP that well so I used a contact form and tried to modify it to include the checkboxes. Didn't work out Please help. <?php // OPTIONS - PLEASE CONFIGURE THESE BEFORE USE! $yourEmail = "hello@mail"; // the email address you wish to receive these mails through $yourWebsite = ""; // the name of your website $thanksPage = ''; // URL to 'thanks for sending mail' page; leave empty to keep message on the same page $maxPoints = 4; // max points a person can hit before it refuses to submit - recommend 4 $requiredFields = "name,email,comments"; // names of the fields you'd like to be required as a minimum, separate each field with a comma // DO NOT EDIT BELOW HERE $error_msg = null; $result = null; $requiredFields = explode(",", $requiredFields); foreach($_POST["service"] as $value) { $service .= "$value\n"; } function clean($data) { $data = trim(stripslashes(strip_tags($data))); return $data; } function isBot() { $bots = array("Indy", "Blaiz", "Java", "libwww-perl", "Python", "OutfoxBot", "User-Agent", "PycURL", "AlphaServer", "T8Abot", "Syntryx", "WinHttp", "WebBandit", "nicebot", "Teoma", "alexa", "froogle", "inktomi", "looksmart", "URL_Spider_SQL", "Firefly", "NationalDirectory", "Ask Jeeves", "TECNOSEEK", "InfoSeek", "WebFindBot", "girafabot", "crawler", "www.galaxy.com", "Googlebot", "Scooter", "Slurp", "appie", "FAST", "WebBug", "Spade", "ZyBorg", "rabaz"); foreach ($bots as $bot) if (stripos($_SERVER['HTTP_USER_AGENT'], $bot) !== false) return true; if (empty($_SERVER['HTTP_USER_AGENT']) || $_SERVER['HTTP_USER_AGENT'] == " ") return true; return false; } if ($_SERVER['REQUEST_METHOD'] == "POST") { if (isBot() !== false) $error_msg .= "No bots please! UA reported as: ".$_SERVER['HTTP_USER_AGENT']; // lets check a few things - not enough to trigger an error on their own, but worth assigning a spam score.. // score quickly adds up therefore allowing genuine users with 'accidental' score through but cutting out real spam $points = (int)0; $badwords = array("adult", "beastial", "bestial", "blowjob", "clit", "cum", "cunilingus", "cunillingus", "cunnilingus", "cunt", "ejaculate", "fag", "felatio", "fellatio", "fuck", "fuk", "fuks", "gangbang", "gangbanged", "gangbangs", "hotsex", "hardcode", "jism", "jiz", "orgasim", "orgasims", "orgasm", "orgasms", "phonesex", "phuk", "phuq", "pussies", "pussy", "spunk", "xxx", "viagra", "phentermine", "tramadol", "adipex", "advai", "alprazolam", "ambien", "ambian", "amoxicillin", "antivert", "blackjack", "backgammon", "texas", "holdem", "poker", "carisoprodol", "ciara", "ciprofloxacin", "debt", "dating", "porn", "link=", "voyeur", "content-type", "bcc:", "cc:", "document.cookie", "onclick", "onload", "javascript"); foreach ($badwords as $word) if ( strpos(strtolower($_POST['comments']), $word) !== false || strpos(strtolower($_POST['name']), $word) !== false ) $points += 2; if (strpos($_POST['comments'], "http://") !== false || strpos($_POST['comments'], "www.") !== false) $points += 2; if (isset($_POST['nojs'])) $points += 1; if (preg_match("/(<.*>)/i", $_POST['comments'])) $points += 2; if (strlen($_POST['name']) < 3) $points += 1; if (strlen($_POST['comments']) < 15 || strlen($_POST['comments'] > 1500)) $points += 2; // end score assignments foreach($requiredFields as $field) { trim($_POST[$field]); if (!isset($_POST[$field]) || empty($_POST[$field])) $error_msg .= "Please fill in all the required fields and submit again.\r\n"; } if (!preg_match("/^[a-zA-Z-'\s]*$/", stripslashes($_POST['name']))) $error_msg .= "The name field must not contain special characters.\r\n"; if (!preg_match('/^([a-z0-9])(([-a-z0-9._])*([a-z0-9]))*\@([a-z0-9])(([a-z0-9-])*([a-z0-9]))+' . '(\.([a-z0-9])([-a-z0-9_-])?([a-z0-9])+)+$/i', strtolower($_POST['email']))) $error_msg .= "That is not a valid e-mail address.\r\n"; if (!empty($_POST['url']) && !preg_match('/^(http|https):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(\d+))?\/?/i', $_POST['url'])) $error_msg .= "Invalid website url.\r\n"; if ($error_msg == NULL && $points <= $maxPoints) { $subject = "Automatic Form Email"; $message = "You received this e-mail message through your website: \n\n"; foreach ($_POST as $key => $val) { $message .= ucwords($key) . ": " . clean($val) . "\r\n"; } $message .= "\r\n"; $message .= 'IP: '.$_SERVER['REMOTE_ADDR']."\r\n"; $message .= 'Browser: '.$_SERVER['HTTP_USER_AGENT']."\r\n"; $message .= 'Points: '.$points; if (strstr($_SERVER['SERVER_SOFTWARE'], "Win")) { $headers = "From: $yourEmail\n"; $headers .= "Reply-To: {$_POST['email']}"; } else { $headers = "From: $yourWebsite <$yourEmail>\n"; $headers .= "Reply-To: {$_POST['email']}"; } if (mail($yourEmail,$subject,$message,$headers)) { if (!empty($thanksPage)) { header("Location: $thanksPage"); exit; } else { $result = 'Thank You! Your email was successfully sent.'; $disable = true; } } else { $error_msg = 'Your mail could not be sent this time. ['.$points.']'; } } else { if (empty($error_msg)) $error_msg = 'Your mail looks too much like spam, and could not be sent this time. ['.$points.']'; } } function get_data($var) { if (isset($_POST[$var])) echo htmlspecialchars($_POST[$var]); } ?> <!DOCTYPE html> <html lang="en"> <head> <title>Contact Us</title> <meta charset="utf-8"> <link rel="stylesheet" href="css/reset.css" type="text/css" media="all"> <link rel="stylesheet" href="css/style.css" type="text/css" media="all"> <script type="text/javascript" src="js/jquery-1.4.2.min.js" ></script> <script type="text/javascript" src="js/cufon-yui.js"></script> <script type="text/javascript" src="js/Humanst521_BT_400.font.js"></script> <script type="text/javascript" src="js/Humanst521_Lt_BT_400.font.js"></script> <script type="text/javascript" src="js/cufon-replace.js"></script> <script type="text/javascript" src="js/roundabout.js"></script> <script type="text/javascript" src="js/roundabout_shapes.js"></script> <script type="text/javascript" src="js/gallery_init.js"></script> <!--[if lt IE 7]> <link rel="stylesheet" href="css/ie/ie6.css" type="text/css" media="all"> <![endif]--> <!--[if lt IE 9]> <script type="text/javascript" src="js/html5.js"></script> <script type="text/javascript" src="js/IE9.js"></script> <![endif]--> </head> <body> <!-- header --> <header> <div class="container"> <h1><a href="index.html"></a></h1> <nav> <ul> <li><a href="index.html">Home</a></li> <li><a href="aboutpg/about.html">About</a></li> <li><a href="currentpg/current.html">Current</a></li> <li><a href="contact.php" class="current">Contact</a></li> </ul> </nav> </div> </header> <!-- #gallery --> <section id="gallery"> <div class="container"> <ul id="myRoundabout"> <li><img src="images/postcard.jpg"></li> </ul> </div> </section> <!-- /#gallery --> <div class="main-box"> <div class="container"> <div class="inside"> <div class="wrapper"> <!-- aside --> <aside> <h2>Contact <span></span></h2> <!-- .contacts --> <ul class="contacts"> <li><strong>Owner:</strong></li> <li><strong>Business:</strong></li> <li><strong>Address:</strong></li> <li><strong> </strong></li> <li><strong>Phone:</strong></li> <li><strong>Email:</strong> <script type="text/javascript"> /*<![CDATA[*/ /*********************************************** * Encrypt Email script- Please keep notice intact * Tool URL: http://www.dynamicdrive.com/emailriddler/ * **********************************************/ <!-- Encrypted version of: [at] *****.*** //--> var emailriddlerarray=[83,80,87,105,110,99,55,55,64,121,97,104,111,111,46,99,111,109] var encryptedemail_id20='' //variable to contain encrypted email for (var i=0; i<emailriddlerarray.length; i++) encryptedemail_id20+=String.fromCharCode(emailriddlerarray) document.write('<a href="mailto:'+encryptedemail_id20+'"></a>') /*]]>*/ </script></li> </ul> <!-- /.contacts --> <h3>Miscellaneous info:</h3> <p><a href="http://www.fireislandferries.com" target="_blank">Fire Island Ferries</a></p> <p><a href="http://www.googlemaps.com" target="_blank">Google Maps</a></p> <p><a href="http://www.fireislandnews.net" target="_blank">Fire Island News</a></p> <p><a href="http://www.fireislandtide.net" target="_blank">Fire Island Tide</a></p> </aside> <!-- content --> <section id="content"> <article> <h2><span>*All fields are required.</span></h2> <?php if ($error_msg != NULL) { echo '<p class="error">ERROR: '. nl2br($error_msg) . "</p>"; } if ($result != NULL) { echo '<p class="success">'. $result . "</p>"; } ?> <form action="<?php echo basename(__FILE__); ?>" method="post"> <noscript> <p><input type="hidden" name="nojs" id="nojs" /></p> </noscript> <label>Services Required (check off as many as required):</label> <br> <input type="checkbox" name="service[ ]" id="service_0" value="addition" align="right">Addition<br> <input type="checkbox" name="service[ ]" id="service_1" value="remodeling">Remodeling<br> <input type="checkbox" name="service[ ]" id="service_2" value="roof">Roof<br> <input type="checkbox" name="service[ ]" id="service_3" value="foundation">Foundation<br> <input type="checkbox" name="service[ ]" id="service_4" value="kitchen">Kitchen<br> <input type="checkbox" name="service[ ]" id="service_5" value="bath">Bath(s)<br> <input type="checkbox" name="service[ ]" id="service_6" value="tile">Tile Work<br> <input type="checkbox" name="service[ ]" id="service_7" value="window">Windows<br> <input type="checkbox" name="service[ ]" id="service_8" value="deck">Deck<br> <input type="checkbox" name="service[ ]" id="service_9" value="painting">Painting<br> <input type="checkbox" name="service[ ]" id="service_10" value="power washing">Power Washing<br> <input type="checkbox" name="service[ ]" id="service_11" value="opening closing">Spring Opening/Fall Closing <br><br> <br /> <p> <small>Name: </small><input type="text" name="name" id="name" value="<?php get_data("name"); ?>" size="22" placeholder="First Last"/> <label for="name"></label> </p> <p> <small>Phone: </small><input type="text" name="email" id="email" value="<?php get_data("phone"); ?>" size="22" placeholder="(123) 123-4567"/> <label for="phone"></label> </p> <p> <small>Email: </small><input type="text" name="email" id="email" value="<?php get_data("email"); ?>" size="22" placeholder="you@email.com"/> <label for="email"></label> </p> <p> <small>Message: </small><textarea name="comments" id="comments" placeholder="Please write a brief message here."><?php get_data("comments"); ?></textarea> <label for="comments" style="display:none;"></label> </p> <p> <input name="submit" type="submit" id="submit" value="Submit Form" <?php if (isset($disable) && $disable === true) echo ' disabled="disabled"'; ?> /> </p> </form> </div> </article> </section> </div> </div> </div> </div> <script type="text/javascript"> Cufon.now(); </script> </body> </html> Working on a project for school and I am trying to code a form that feeds into a DB. I have been studying the syntax, reading and doing everything I can to get this to work. A little help, pointers, direction would be greatly appreciated. It may be my database structure so I included a image for anyone to see... and the files. Thanks in advance [attachment deleted by admin] Hi. My form involves a checkbox. Below is the code. The problem is that when I am not sure what to put on the php. I need for people to be able to check one box tow boxes or all three boxes. On the form side I have this: type="checkbox" name="formcheck[]" value="C". Not sure what to put on the php side and need some assistance Code: [Select] <label style="display: block; padding-left: 15px; text-indent: -15px; width:650px;"> <input style="width: 45px; height: 45px; padding: 0; margin:0; vertical-align: bottom; position: relative; top: -1px; *overflow: hidden;" type="checkbox" name="formcheck[]" value="A" /> Directory Listing </label> <label style="display: block; padding-left: 15px; text-indent: -15px;width:650px;"> <input style="width: 45px; height: 45px; padding: 0; margin:0; vertical-align: bottom; position: relative; top: -1px; *overflow: hidden;" type="checkbox" name="formcheck[]" value="B" /> Full page listing </label> <label style="display: block; padding-left: 15px; text-indent: -15px;width:650px;"> <input style="width: 45px; height: 45px; padding: 0; margin:0; vertical-align: bottom; position: relative; top: -1px; *overflow: hidden;" type="checkbox" name="formcheck[]" value="C" /> Receive a link to your website </label> This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=330011.0 I have a form where people enter in values and I need these values displayed in the proper format. I need the output string to have a "<" at the beginning and a ">" at the end but whenever I put the code in to add the < in the beginning nothing shows up. Here is my code. I am able to get it to work with just adding the > at the end but it seems when I add "<" to the beginning this is where nothing shows up. Code: [Select] <?php $hairbald = trim($_POST['HairBald']); $eyes = trim($_POST['Eyes']); $test =$eyes.'.'.$hairbald; if(empty($test)) { $test = $test; } else $test = '<'.$test.'>'; ?> If the user selects blue eyes and bald head I need the output to be <blue.bald> Hi Guys, I'm struggling with a submit form via ajax. This is the code, but I've been looking for about 3 hours and cannot work out why it doesnt submit the form... Any ideas? <script type="application/javascript"> function addForm() { $.ajax({type:'POST', url: 'cart.php?ajax=1&a=add&domain=register', data:$('#add-form').serialize(), success: function(response) { $('#add-form').find('.form_result').html(response); }}); return false; } function transferForm() { $.ajax({type:'POST', url: 'cart.php?ajax=1&a=add&domain=transfer', data:$('#transfer-form').serialize(), success: function(response) { $('#transfer-form').find('.form_result').html(response); }}); return false; } </script>My code is mixed with smarty but the call is just a standard call {foreach from=$availabilityresults key=num item=result} {if $result.status eq "available"} <form method="post" id="add-form" onsubmit="return addForm();"> {else} <form method="post" id="transfer-form" onsubmit="return transferForm();"> {/if} <table width="700" border="0" cellspacing="5" cellpadding="0"> <input type="hidden" name="domain" value="{$result.domain}" /> <tr style="border-bottom: #333 1px solid;"> <td rowspan="2">{if $result.status eq "available"}<img src="templates/dj/yes.jpg" />{else}<img src="templates/dj/no.jpg" />{/if}</td> {if $result.status eq "available"}<td style="color:#339933;" />{$result.domain|replace:$domain:''}</td>{else}<td style="color:#cc0000;" />{$result.domain|replace:$domain:''}</td>{/if} <td rowspan="2">{$result.domain}</td> <td rowspan="2">{if $result.status eq "unavailable"}{else} <select name="domainsregperiod[{$result.domain}]"> {foreach key=period item=regoption from=$result.regoptions} <option value="{$period}">{$period} {$LANG.orderyears} @ {$regoption.register}</option> {/foreach} </select> {/if}</td> <td rowspan="2">{if $result.status eq "available"} <input type="image" src="templates/dj/add-basket.jpg" border="0" alt="Add to Basket" /><div class="form_result"> Added to Basket </div> {else} <input type="image" src="templates/dj/transfer.jpg" border="0" alt="Transfer to Us" /> {/if}</td> </tr> <tr> <td>{if $result.status eq "available"}Available{else}Taken{/if}</td> </tr> <tr><td colspan="8" style="height:1px; background-color:#999;"></td></tr> </table> </form> {/foreach} |