Jump to content

Drummin

Members
  • Posts

    1,004
  • Joined

  • Last visited

Everything posted by Drummin

  1. Not to confuse you but I wanted to explain that if you don't define the value using => in a foreach statement the AS will be the VALUE instead of the KEY. So foreach($_POST['answerArray'] as $v){ //$v is the content }
  2. <select id="category" name="category" multiple="multiple">
  3. I will try my best... <textarea id="question1" name="answerArray[0]" To me, it looks sorta like I am creating an Array here?! Yes, by adding brackets to a name field in a form you are creating an array. At this point it is a $_POST array. And in your case you are also assigning the Key for each posted answerArray. And what happens when the User types "I want to run my own business because..." in the first Form Field? ...and submits the form... we process creating a php array called answerArray. These are the values you are echoing in your form. No. The form names are hard coded and it's what will be POSTed and if you didn't echo the php array value inside the form, the value would still be empty when posting again, even though we make an array called answerArray when processing. If the fact that the names of the form array and php array are the same is hard to grasp, you could always change one of them but I see no need to as they're in a different format, html, php. $_POST['answerArray'] is an array containing the keys and values from the form. The foreach statement is taking this posted array and creating a php array called answerArray that you can then echo in your form or process to DB etc. OK Debbie. Based on your code. if ($_SERVER['REQUEST_METHOD']=='POST'){ Should replace what I have if (isset($_POST)){ So the trigger for processing should have been what you had. if ($_SERVER['REQUEST_METHOD']=='POST'){ $answerArray=array(); foreach($_POST['answerArray'] as $k =>$v){ $answerArray[$k]=trim($v); } } foreach() is used to get the Key and Value from an array. $_POST['answerArray'] is the array being passed by your form. Each Key has a corresponding Value and so $_POST['answerArray'][9] will hold the value for answer nine etc. Not sure how else to explain this.
  4. As far as your textarea names, name="answerArray[0]" etc. these look right. The "foreach" is going to grab that zero that's within the brackets or 0 from example above, and define it AS $k. if you add this to the top of your page is will make things more clear. echo "<pre>"; print_r($_POST); echo "</pre>"; You'll see the post is an array but also the name "answerArray" is an array with Keys and Values. What the foreach does, is assign these keys and values to variables that you can use. So if for example your form has name="answerArray[22]", the foreach will say the Key($k) is 22 and the Value($v) is the content for this key. foreach($_POST['answerArray'] as $k =>$v){ You then do what you want with these variables, in this case you want an array named $answerArray. You assign the Key, $answerArray[$k] then say the value for this Key $answerArray[$k]=$v; But you also want to trim this value so you add trim() $answerArray[$k]=trim($v); Hope that helps
  5. I really can't address the speed, but it is common to break things into useable parts to it's easier understand. Even html parts are often saved as separate sections, eg. require("header.php"); etc. It's even a good idea in mho to only require "parts" that are needed for a particular page, so doing a simple task doesn't need to scan through a huge processing page to find the matching processing script.
  6. if (isset($_POST)){ $answerArray=array(); foreach($_POST['answerArray'] as $k =>$v){ $answerArray[$k]=trim($v); } }
  7. Well I am surprised you got it looking like you did without defining the placement of image and text. This is a css issue really, but I would probably use floating div's inside a container div. This is a basic (untested) example of what I'm talking about where image is in one div and text is in another, with a break(clear:both) for each record, inside a wrapper div. I added a padding-top of 10px to the text box. I added an undefined class for each div that you can "style" in your css instead of using inline styling. Again this is just a sample so adjust as needed. echo '<div class="container" style="float:left;">'; while($row = mysql_fetch_array($result)) { // Loop through results $i++; echo '<div class="imageholder" style="float:left;">'; echo '<img class="image1" src="'. $row['images'] .'" />'; //image echo '</div>'; echo '<div class="textholder" style="float:left; padding-top:10px;">'; echo "<span style=\"color:green;\"><b>Displaying record $i<br>\n</b><br></span>"; echo "<b>" . $row['id'] . "</b><br>\n"; // Where 'id' is the column/field title in the database echo "Location: ". $row['Location'] . "<br>\n"; // Where 'location' is the column/field title in the database echo "Property Type: ". $row['Property_type'] . "<br>\n"; // as above echo "Bedrooms: ". $row['Number_of_bedrooms'] . "<br>\n"; // .. echo "Purchase Type: ". $row['Purchase_type'] . "<br>\n"; // .. echo "Price: ". $row['Price_range'] . "<br>\n"; // .. echo '</div>'; echo '<div style="clear:both"></div>'; } echo '</div>';
  8. Missing the "greater than" sign and quotes are off. echo "<span style=\"color:green;\"><b>Displaying record $i<br>\n</b><br></span>";
  9. You wouldn't use an id as id's need to be unique to the page, and thus would only be valid for one loop. Use a css class instead.
  10. Hey glad you got it working. As pointed out already, it's a good idea to have processing above (everything else) so query reflects changes made.
  11. As I don't have a table to check the page, I was just winging it. What does the error say?
  12. <?php include 'connection.php'; if(isset($_POST['submit'])){ $newtitle=mysql_real_escape_string(trim($_POST['title'])); $newbody=mysql_real_escape_string(trim($_POST['body'])); $updateid=mysql_real_escape_string(trim($_POST['id'])); $update = "UPDATE news SET title='$newtitle', body='$newbody' WHERE id='$updateid'"; mysql_query($update) or die(mysql_error()); //Can't send anything to browser if using headers //echo "The news article has been Modified!"; header('Location: /News/admin.php'); }//if(isset($_POST['submit'])) else{ if (isset($_GET['id'])){ $getid=mysql_real_escape_string(trim($_GET['id'])); $query = "SELECT title,body FROM news WHERE id=$getid"; $result = mysql_query($query); $news = mysql_fetch_array($result); $title = $_POST['title']; $body = $_POST['body']; }//if (isset($_GET['id'])) }//if(isset($_POST['submit'])) ELSE ?> <html> <head> <title></title> <h1>Edit Article</h1> <form action="" method="post"> Title:<input type="text" name="title" value="<?php if (isset($title)){ echo $title;} ?>" /><br /> Article:<textarea cols="35" rows="6" name="body"><?php if (isset($body)){ echo $body;} ?></textarea> <br /> <input type="hidden" name="id" value="<?php if (isset($_GET['id'])){ echo $_GET['id'];} ?>" /> <input type="image" src="/images/news/modify.png" name="submit" /> </form> <a href="admin.php"><img src="/images/news/cancel.png" border="0" /></a>
  13. Assuming as DavidAM pointed out you DO have a primary column in your table called del_id then you could do this. Note processing really should be done above <html> and output sent to browser. <?php // Check if delete button active, start this if(isset($_POST['delete'])) { $ids = implode(', ', $_POST['delete_these']); $sql = "DELETE FROM table WHERE id IN($ids)"; $result = mysql_query($sql); if($result){ header("location: delete_multiple.php"); exit; } } ?> <html> <head> <title></title> </head> <body> <?php $result = mysql_query("SELECT * FROM contact ORDER BY msg_id ASC"); echo "<form action=\"\" method=\"post\">"; echo "<table border='1'> <tr> <th>Delete</th> <th>Message ID</th> <th>Name</th> <th>Email</th> <th>Message</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td align=\"center\" bgcolor=\"#FFFFFF\"><input name=\"delete_these[]\" type=\"checkbox\" id=\"checkbox[]\" value=\"{$row['del_id']}\"></td>"; echo "<td>" . $row['msg_id'] . "</td>"; echo "<td>" . $row['name'] . "</td>"; echo "<td>" . $row['email'] . "</td>"; echo "<td>" . $row['msg'] . "</td>"; echo "</tr>"; } echo "<tr>"; echo '<td colspan="5" align="center" bgcolor="#FFFFFF"><input name="delete" type="submit" id="delete" value="Delete"></td>'; echo "</tr>": echo "</table>"; echo "</form>"; ?> </body> </html>
  14. Did you implement the suggestion made by jesirose? Maybe showing current page (form included) would shed some light on things.
  15. Vjmehra, in case you want to go with my original code, I had just created a simple table for stations. CREATE TABLE IF NOT EXISTS `call sp_station` ( `station_id` int(11) NOT NULL AUTO_INCREMENT, `station_name` varchar(50) NOT NULL, PRIMARY KEY (`station_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  16. OK then how does it work putting your procedure back in? <?php $host = ""; $login = ""; $dbpass = ""; $db = ""; //Add session_start to top of each page// session_start(); //Make connection to DB mysql_connect("$host","$login","$dbpass") OR DIE ("There is a problem with the system. Please notify your system administrator." .mysql_error()); mysql_select_db("$db") OR DIE ("There is a problem with the system. Please notify your system administrator." .mysql_error()); // do some house keeping // //adds slashes if the magic quotes is off. function addslash($string) { if (!get_magic_quotes_gpc()) $string = addslashes($string); return $string; } if (get_magic_quotes_gpc()) { function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); return $value; } $_POST = array_map('stripslashes_deep', $_POST); $_GET = array_map('stripslashes_deep', $_GET); $_COOKIE = array_map('stripslashes_deep', $_COOKIE); $_REQUEST = array_map('stripslashes_deep', $_REQUEST); } //Delete if (isset($_POST['Delete'])){ mysql_query("DELETE FROM tblvenue WHERE venue_id='{$_POST['venue_id']}'"); } //New if (isset($_POST['NewVenue'])){ if (!empty($_POST['newstat_id']) && !empty($_POST['newtbvenue_name'])){ $newtbvenue_name = mysql_real_escape_string(trim($_POST['newtbvenue_name'])); mysql_query("INSERT INTO tblvenue (venue_name,station_id) VALUES('$newtbvenue_name','{$_POST['newstat_id']}')"); } } //Update if (isset($_POST['Update'])){ if (!empty($_POST['stat_id']) && !empty($_POST['tbvenue_name'])){ $tbvenue_name = mysql_real_escape_string(trim($_POST['tbvenue_name'])); mysql_query("UPDATE tblvenue SET venue_name='$tbvenue_name', station_id='{$_POST['stat_id']}' WHERE venue_id='{$_POST['venue_id']}'"); } } ?> <!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> <title>Update & Delete Venues</title> <style type="text/css"> body{ margin:0; padding:0; background-color:#B0E0E6; } .tablestyle{ border:1px solid black; margin:0; border-collapse:collapse; padding:0; } </style> </head> <body> <?php echo "<form action=\"\" method=\"post\" style=\"padding:0 margin:0\">\r"; echo "<table border=\"1\" class=\"tablestyle\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"padding:0 margin:0\">\r"; echo "<tr>\r"; echo "<td align=\"center\" width=\"33%\">Action</td>\r"; echo "<td align=\"center\" width=\"33%\">Venue Name</td>\r"; echo "<td align=\"center\" width=\"33%\">Station Name</td>\r"; echo "</tr>\r"; echo "<tr>\r"; echo "<td align=\"center\"><input type='submit' value='Add New Venue' name='NewVenue' style=\"width:100%;\" /></td>\r"; echo "<td align=\"center\"><input type='text' name='newtbvenue_name' style=\"width:100%;\" /></td>\r"; echo "<td align=\"center\">\r"; echo "<select name=\"newstat_id\" style=\"width:100%;\">\r"; echo "<option value=\"\"> - Select - </option>\r"; $stat_array=get_dataset('localhost', 'root', 'snooker1', 'pool',"call sp_station"); foreach ($stat_array as $thiscat) { echo '<option value="' . $thiscat['station_id'] . '"'; if ($row['station_id'] == $thiscat['station_id']) {echo ' selected';} echo '>' . $thiscat['station_name'] . '</option>'; } echo "</select>\r"; echo "</td>\r"; echo "</tr>\r"; echo "</table>\r"; echo "</form>\r"; //--------------------------------------------------------------------- //Critics of *, this table only has three fields, all used here. $sql="SELECT * FROM `tblvenue` ORDER BY venue_name ASC"; $result=mysql_query($sql); while($row=mysql_fetch_array($result)){ echo "<form action=\"\" method=\"post\" style=\"padding:0 margin:0\">\r"; echo "<table border=\"1\" class=\"tablestyle\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"padding:0 margin:0\">\r"; echo "<tr>\r"; echo "<td width=\"33%\">\r<input type=\"hidden\" name=\"venue_id\" value=\"{$row['venue_id']}\" />\r"; echo "<div style=\"width:50%; text-align:center;float:left;\">\r<input type=\"submit\" name=\"Delete\" value=\"Delete\" style=\"width:100%;\" />\r</div>\r"; echo "<div style=\"width:50%; text-align:center;float:left;\">\r<input type=\"submit\" name=\"Update\" value=\"Update\" style=\"width:100%;\" />\r</div>\r"; echo "</td>\r"; echo "<td width=\"33%\">\r<input type='text' name='tbvenue_name' value=\"".$row['venue_name']."\" style=\"width:100%;\" /></td>\r"; echo "<td width=\"33%\">\r"; echo "<select name=\"stat_id\" style=\"width:100%;\">\r"; $stat_array=get_dataset('localhost', 'root', 'snooker1', 'pool',"call sp_station"); foreach ($stat_array as $thiscat) { echo '<option value="' . $thiscat['station_id'] . '"'; if ($row['station_id'] == $thiscat['station_id']) {echo ' selected';} echo '>' . $thiscat['station_name'] . '</option>'; } echo "</select>\r"; echo "</td>\r"; echo "</tr>\r"; echo "</table>\r"; echo "</form>\r"; } ?> </body> </html>
  17. Sorry, It worked perfectly for me and I doubt it's a matter of the way I coded it. Can I assume you added DB info at the top of the page? I was a little suspicious of the table named `call sp_station` as there's a space in the name. Do the table names match what you have? Any errors shown? In what way doesn't it work?
  18. I don't know how many times I've seen this log in code but wherever it's from, stop using it. session_register is depreciated. Make you page as follows. <?php session_start(); // any pre-processing code goes here and DB connection //Grab useful information with query like userid, level $sql="SELECT userid,level FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); if (mysql_num_rows($result)){ $row = mysql_fetch_row($result); //Set useful information to session, but NEVER password $_SESSION['myusername']=$myusername; $_SESSION['userid']=$row[0]; $_SESSION['level']=$row[1]; if ($_SESSION['level']=="admin"){ header("location: adminhome.php"); }else{ header("location: memberhome.php"); } }else{ //set error to variable to display below $error="Wrong Username or Password"; } // html and head goes here ?> <html> <body> <?php if (isset($error)) { echo $error; } ?> form goes here </body> </html> You should add code to check $_SESSION['level'] on all protected pages.
  19. You can rename the file on the server to whatever you want. I even recommend it. Whatever name, whatever directory. What the user will see is what you show them. As long as you store the original information (eg, filename) somewhere then you can show it to them later. For example, download scripts. The URL can be anything because the (suggested) name of the downloaded file is given by your script in the Content-Disposition header. Thanks for the advice. How do I go about renaming the file back to the original when It's downloaded? And also thanks to The Little Guy for the link but I'm trying to not use any outside programs requiring a license.
  20. Working on a music/video project. Uploaded tracks are stored in user files and product info is stored to DB. What I've been trying to figure out is getting the product information directly from the upload, much like you see in the shot attached. As I haven't had success with that, I've been trying to get the duration of a track using this code. $fp = fopen($file, 'r'); $size_in_bytes = filesize($file); fseek($fp, 20); $rawheader = fread($fp, 16); $header = unpack('vtype/vchannels/Vsamplerate/Vbytespersec/valignment/vbits', $rawheader); $tsec = number_format($size_in_bytes/$header['bytespersec'],2); $minutes = intval(($tsec / 60) % 60); $seconds = intval($tsec % 60); $sec="$minutes".":".($seconds<10 ? "0$seconds" : "$seconds"); This is working fine when file names are plain text, however it fails when when there are commas or brackets. I don't know if the code can be adjusted to work with these file names or I need to take a different approach. examples $file ="A cool track, once again"; $file ="A cool track (once again)"; As artists can be picky about their music, I don't want to rename their tracks, but really we shouldn't even have spaces in the names. I could save original name to DB and rename the file, but not sure about restoring original when it come time to download the file. In any case, I hope you understand my problem and can offer some advice. Thanks.
  21. Well for one, you can't have html code between table tags. Maybe this is more what you want to do. if($showHeader) { //Display category header echo "<tr>"; echo "<td><h1><span>#</span></h1></td>"; echo "<td><h1>" . $row['cat'] . "</h1></td>"; echo "<td><h1><span>#</span></h1></td>"; echo "</tr>\n"; echo "<tr>"; echo "<td colspan=\"3\"><h2>" . $row['cat_descr'] . "</h2></td>"; echo "</tr>\n"; $showHeader = false; }
  22. Here's my take on your code. <?php include "connection.php"; session_start(); $msg=""; //We only one solid isset field in the form to trigger validation. if (isset($_POST['username'])){ if (empty($_POST['username'])){$msg .= "empty uname <br/>";} if (empty($_POST['oldpass'])){$msg .= "empty oldy <br/>";} if (empty($_POST['pass1'])){$msg .= "empty pass1 <br/>";} if (empty($_POST['pass2'])){$msg .= "empty pass2 <br/>";} if(trim($_POST['pass1']) != trim($_POST['pass2'])){ $msg .= "Passwords do not match"; } if (empty($msg)){ $user = mysql_real_escape_string(trim($_POST['username'])); $oldpass= mysql_real_escape_string(trim($_POST['oldpass'])); $pass1 = mysql_real_escape_string(trim($_POST['pass1'])); $pass2 = mysql_real_escape_string(trim($_POST['pass2'])); //It's much more reliable to update a record based on an id rather than a username, so grab id in query. $sql="SELECT id FROM user WHERE username='$user' and password='$oldpass'"; $result= mysql_query($sql); if (mysql_num_rows($result)){ $row = mysql_fetch_row($result); $sql=mysql_query("UPDATE user SET password='$pass2' where id='{$row[0]}'"); $msg .="Congrats you have successfully changed your password."; } //Unless you're planning a running seperate checks for username and password, pass general message to user. else{ $msg .="The Username and Password conbination does not Exist";} } } ?> <!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> <title>Change Password</title> <style type="text/css"> .wrapper{ float:left; width:350px; } .left{ float:left; text-align:right; width:50%; } .right{ float:right; width:50%; } .full{ float:left; width:100%; } .clear{ clear:both; } .error{ color:red; text-align:center; } </style> </head> <body> <form method="post" action=""> <div class="wrapper"> <div class="full error"><?php echo $msg; ?></div><div class="clear"></div> <div class="left">Username: </div><div class="right"><input type="text" name="username" /></div> <div class="clear"></div> <div class="left">Old password: </div><div class="right"><input type="password" name="oldpass" /></div> <div class="clear"></div> <div class="left">New password: </div><div class="right"><input type="password" name="pass1" /></div> <div class="clear"></div> <div class="left">Confirm New password: </div><div class="right"><input type="password" name="pass2" /></div> <div class="clear"></div> <div class="full"><input class="cpassbtn" name="Submit" type="image" value="Submit" src="passnrm.png" onmouseover="this.src='passhvr.png'" onmouseout="this.src='passnrm.png'" /> </div> </div> </form> </body> </html>
  23. When looking at this situation, it came down to using checkboxes by each record and having one submit button at the bottom or wrapping each record in a form and each having a delete and update button. For usability sake, I opted for the second one, as user can just modify field and click update or delete. And besides, you already had buttons by each record. Sure wrapping a form around each table does use some resources but I did remove a bunch of DB queries by not querying the station table for every record. This sample adds new venues, updates or deletes existing ones, All on one page. Sure it's different than what you had going, but I think it will do the job for you. If you need the first option that's not hard to do. Just need a select checkbox by each record and single update and delete buttons at the bottom. <?php $host = ""; $login = ""; $dbpass = ""; $db = ""; //Make connection to DB mysql_connect("$host","$login","$dbpass") OR DIE ("There is a problem with the system. Please notify your system administrator." .mysql_error()); mysql_select_db("$db") OR DIE ("There is a problem with the system. Please notify your system administrator." .mysql_error()); // do some house keeping // //adds slashes if the magic quotes is off. function addslash($string) { if (!get_magic_quotes_gpc()) $string = addslashes($string); return $string; } if (get_magic_quotes_gpc()) { function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); return $value; } $_POST = array_map('stripslashes_deep', $_POST); $_GET = array_map('stripslashes_deep', $_GET); $_COOKIE = array_map('stripslashes_deep', $_COOKIE); $_REQUEST = array_map('stripslashes_deep', $_REQUEST); } //Delete if (isset($_POST['Delete'])){ mysql_query("DELETE FROM tblvenue WHERE venue_id='{$_POST['venue_id']}'"); } //New if (isset($_POST['NewVenue'])){ if (!empty($_POST['newstat_id']) && !empty($_POST['newtbvenue_name'])){ $newtbvenue_name = mysql_real_escape_string(trim($_POST['newtbvenue_name'])); mysql_query("INSERT INTO tblvenue (venue_name,station_id) VALUES('$newtbvenue_name','{$_POST['newstat_id']}')"); } } //Update if (isset($_POST['Update'])){ if (!empty($_POST['stat_id']) && !empty($_POST['tbvenue_name'])){ $tbvenue_name = mysql_real_escape_string(trim($_POST['tbvenue_name'])); mysql_query("UPDATE tblvenue SET venue_name='$tbvenue_name', station_id='{$_POST['stat_id']}' WHERE venue_id='{$_POST['venue_id']}'"); } } //create array for stations so query is not run with every record $stations = array(); $sqls="SELECT * FROM `call sp_station` "; $results=mysql_query($sqls); while($stat=mysql_fetch_array($results)){ $stations[$stat['station_id']]=$stat['station_name']; } ?> <!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> <title>Update & Delete Venues</title> <style type="text/css"> body{ margin:0; padding:0; background-color:#B0E0E6; } .tablestyle{ border:1px solid black; margin:0; border-collapse:collapse; padding:0; } </style> </head> <body> <?php echo "<form action=\"\" method=\"post\" style=\"padding:0 margin:0\">\r"; echo "<table border=\"1\" class=\"tablestyle\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"padding:0 margin:0\">\r"; echo "<tr>\r"; echo "<td align=\"center\" width=\"33%\">Action</td>\r"; echo "<td align=\"center\" width=\"33%\">Venue Name</td>\r"; echo "<td align=\"center\" width=\"33%\">Station Name</td>\r"; echo "</tr>\r"; echo "<tr>\r"; echo "<td align=\"center\"><input type='submit' value='Add New Venue' name='NewVenue' style=\"width:100%;\" /></td>\r"; echo "<td align=\"center\"><input type='text' name='newtbvenue_name' style=\"width:100%;\" /></td>\r"; echo "<td align=\"center\">\r"; echo "<select name=\"newstat_id\" style=\"width:100%;\">\r"; echo "<option value=\"\"> - Select - </option>\r"; if (!empty($stations)){ foreach($stations as $k => $v){ echo "<option value=\"$k\">$v</option>\r"; } } echo "</select>\r"; echo "</td>\r"; echo "</tr>\r"; echo "</table>\r"; echo "</form>\r"; //--------------------------------------------------------------------- //Critics of *, this table only has three fields, all used here. $sql="SELECT * FROM `tblvenue` ORDER BY venue_name ASC"; $result=mysql_query($sql); while($row=mysql_fetch_array($result)){ echo "<form action=\"\" method=\"post\" style=\"padding:0 margin:0\">\r"; echo "<table border=\"1\" class=\"tablestyle\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"padding:0 margin:0\">\r"; echo "<tr>\r"; echo "<td width=\"33%\">\r<input type=\"hidden\" name=\"venue_id\" value=\"{$row['venue_id']}\" />\r"; echo "<div style=\"width:50%; text-align:center;float:left;\">\r<input type=\"submit\" name=\"Delete\" value=\"Delete\" style=\"width:100%;\" />\r</div>\r"; echo "<div style=\"width:50%; text-align:center;float:left;\">\r<input type=\"submit\" name=\"Update\" value=\"Update\" style=\"width:100%;\" />\r</div>\r"; echo "</td>\r"; echo "<td width=\"33%\">\r<input type='text' name='tbvenue_name' value=\"".$row['venue_name']."\" style=\"width:100%;\" /></td>\r"; echo "<td width=\"33%\">\r"; echo "<select name=\"stat_id\" style=\"width:100%;\">\r"; if (!empty($stations)){ foreach($stations as $k => $v){ echo "<option value=\"$k\"" . ($row['station_id']=="$k" ? ' selected="selected"' : '') . ">$v</option>\r"; } } echo "</select>\r"; echo "</td>\r"; echo "</tr>\r"; echo "</table>\r"; echo "</form>\r"; } ?> </body> </html>
  24. Can you post code for include 'mysql-connect.php'; ? Somewhere you are using session_is_registered()
×
×
  • 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.