PHP - How To Tell Whats Changed.
Ive created a process which automatically creates a form for all of the "courses" that are listed in a database. This table shows the name, the course code, the current program the course is under and an option to delete the course. I have created a drop down menu for the user to select any of the current programs to switch the course into. My problem is I have X amount of select fields and radio buttons and I dont know how to tell which one has been changed below is my code, appreciate the help!:
case "ep": if (isset ($_GET['id'])){ $id = $_GET['id']; echo "Below lists all of the current courses under this program. Once you have made all of the changes click the submit button at the bottom of the page. <br><br><br>"; $query = "SELECT * FROM courses WHERE cid = $id"; $result = mysql_query($query) or die (mysql_error()); echo "<form action=\"course_process.php\" method=\"post\">"; echo "<table><tr><td><strong>Course Name</strong></td><td><strong>Course Code</strong></td><td><strong>Change Course Program</strong></td><td><strong>Delete</strong></td></tr>"; $i = 0; while ($row = mysql_fetch_assoc($result)){ $r = $row['id']; $query2 = "SELECT * from catagories"; $result2 = mysql_query($query2) or die (mysql_error()); echo "<tr><td> ". $row['name']. " </td><td> ".$row['code']." </td><td><select name=\"".$row['id']."\">"; while ($row2 = mysql_fetch_assoc($result2)){ echo "<option value=".$row2['id'].">".$row2['name']. "</option>"; } echo "</select></td><td><input name=\"".$row['id']."\" type=\"radio\" value=\"Click to delete\" /></td></tr>"; } echo "<tr><td></td><td></td><td></td><td><input name=\"submit\" type=\"submit\" value=\"Commit Changes\" /> </td></tr></table></form>"; }else{ echo "Invalid action request. ERROR CODE 1"; } break; Similar TutorialsI have an upload script that has been working just fine for months now.. I didn't change a thing,, now people are saying they are getting a internal server error... I checked it myself and I am getting the same thing. There is no error number,, so I can't look it up.. My upload script is good for 30mb's and has been just fine up til now.. Any ideas? Could GoDaddy just be having probs? The error is only shown after the upload is started.. the upload starts, then about 30 seconds later, it appears. Alright guys.. I need some advice, some recommendations and definitely some help. I've got a submission form for users to upload an image and some basic personal information. The client wanted the information to be divided by the North America (specifically N.A. and not U.S.) and Europe.. so I created a database table with the typical structu a row for the user's name, email, etc. I also added a row labeled "regionid" in which "1" would equal North America and "2" would equal Europe. This "regionid" row would obviously organize the submission by their country. The client specifically wanted to label North America but mentioned only users from the States would probably only submit images, etc. Users could choose if they were submitting a form for US or Europe and "regionid" would be filled by which form was chosen. Recently, the client threw a curveball and now wants Canada as part of the North America submission form. Now, I don't want to add Canada as another option for my "regionid" row because it does belong under North America. However, I need to alter the structure of the database I currently have so that it can now organize if under North America or Europe, and if under North America, if the submission falls under the United States or Canada. I was thinking of adding a drop down menu under the North America form with the options US or Canada. Do you guys have any advice or other directions you would take to solve this problem.. that is, if my situation is even understandable? I found it pretty difficult to explain! Apologies! Hello everybody,
I have a form like that:
<form method="post" action="x.php"> <input type="hidden" name="pubid" value="<?php echo $_SESSION["public_id"][$a]; ?>" /> <input type="submit" name="update" />The public id is an id that every user have and that I use for get and post, imagine that this form is in a php "for" that print all this forms with public_id. Then I have a code like that: if(isset($_POST["update])){ if($_POST["pubid"]!==(There are some checks to avoid mysql injection)){ mysql_query=update from xxx set x=1 where pubid=$_POST["pubid"])(EXEMPLE) }}I want to avoid any change of form, because if someone change the value of the hidden input can modify information of mysql, someone know any method to do that? A friend told me to use js to compare form fields, but the user can modify js too I think, then I need to check it with php I think, correct me if Im wrong. Someone help me please. Hey Guys,
I'm doing some coding and I've managed to snip something off....
This is the original code
<form method="post" action="{$systemsslurl}cart.php?a=add&domain=register"> <table class="table table-striped table-framed"> <thead> <tr> <th></th> <th>{$LANG.domainname}</th> <th class="textcenter">{$LANG.domainstatus}</th> <th class="textcenter">{$LANG.domainmoreinfo}</th> </tr> </thead> <tbody> {foreach from=$availabilityresults key=num item=result} <tr> <td class="textcenter">{if $result.status eq "available"}<input type="checkbox" name="domains[]" value="{$result.domain}" {if $num eq "0" && $available}checked {/if}/><input type="hidden" name="domainsregperiod[{$result.domain}]" value="{$result.period}" />{else}X{/if}</td> <td>{$result.domain}</td> <td class="textcenter {if $result.status eq "available"}domcheckersuccess{else}domcheckererror{/if}">{if $result.status eq "available"}{$LANG.domainavailable}{else}{$LANG.domainunavailable}{/if}</td> <td class="textcenter">{if $result.status eq "unavailable"}<a href="http://{$result.domain}" target="_blank">WWW</a> <a href="#" onclick="popupWindow('whois.php?domain={$result.domain}','whois',650,420);return false">WHOIS</a>{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> </tr> {/foreach} </table> <p align="center"><input type="submit" value="{$LANG.ordernowbutton} »" class="btn btn-danger" /></p> </form>and I've changed it to: <form method="post" action="{$systemsslurl}cart.php?a=add&domain=register"> {foreach from=$availabilityresults key=num item=result} {if $result.status eq "available"} <div style="width: 400px; color: #339933; font-size:14px;"><img src="/templates/dj/yes.jpg" style="float:left" />{$tld}<br />Available</div> <div style="width: 100px;" >{$name}<p style="color: #339933;">{$tld}</p></div> <div style="width: 200px;" ><select name="domainsregperiod[{$result.domain}]">{foreach key=period item=regoption from=$result.regoptions}<option value="{$period}">{$period} {$LANG.orderyears} @ {$regoption.register}</option>{/foreach}</select> <input type="submit" value="{$LANG.ordernowbutton} »" class="btn btn-danger" /></div> {/if} {if $result.status eq "unavailable"} <div style="width: 400px; color: #cc0000; font-size:14px;"><img src="/templates/dj/no.jpg" style="float:left" />{$tld}<br />Taken</div> <div style="width: 100px;" >{$domain}<p style="color: #cc0000;">{$tld}</p></div> <div style="width: 200px;" ><a href="http://{$result.domain}" target="_blank">WWW</a> <a href="#" onclick="popupWindow('whois.php?domain={$result.domain}','whois',650,420);return false">WHOIS</a></div> {/if} {/foreach}</form>The original code works fine and add to my cart, the new "updated" version fails... What have I done wrong? I have no idea if this is possible or not, but I've got a form that searches a DB for a record. If that record is found, it displays a form that people can edit the record. Now, if that person wants to change (for example) 1 record out of 16 called "status" from "lost" to "found" but leave all the rest as they are, how would I go about this? Basically, I need to check all the fields ON SUBMIT if they're different from the original values in the DB and only update if they are. Any help would be appreciated. Cheers, Dave After switching from PHP 5.3 on Windows Server 2003 to PHP 7.4.3 on Linux Mint 19.3 (Tricia Cinnamon), I find that the output of print_r() has changed. If we look at the documentation (https://www.php.net/manual/en/function.print-r.php), the provided example output is as it was on my earlier machine: <pre> Array ( [a] => apple [b] => banana [c] => Array ( [0] => x [1] => y [2] => z ) ) </pre> However, on the second machine, the output is: <pre> Array ( [a] => apple [b] => banana [c] => Array ( [0] => x [1] => y [2] => z ) <blank line> ) </pre> Note the unexpected new line after each recursed array's closing parenthesis. The new line is not present after the outermost array closing parenthesis. Also to note, there is a newer version of XDebug installed. My question is: Is this a bug? (Follow-on question: if possible to determine at which version the output changed, what version would that be?) This difference is causing existing code to not be able to correctly parse that output. OK I'm 98% new to PHP. I'm trying to do my own website and my idea will work something like this: index.php ____________________ Header + Nav {PHP INCLUDE} Footer ____________________ The content will reside in another *.php page If you look at www.avlscotland.com/test 'temporary' It loads default.php when you go to the page which is perfect. I have it working in basic form although only the hyperlinks HOME - ABOUT AVL - DEAD LINK are active at this moment. So it works this way with everything in the same directory, but I want it to load the content from a subdirectory /test/pages/content.php This is the PHP code I am using <?php // Check if page has been requested if (!isset($_GET['content'])) { // Page has not been requested, show default page $content = 'default.php'; } else { // Page has been requested, validate page exists, show page $content = $_GET['content'].'.php'; } // End if page has been requested // Check to see if page exists if (file_exists($content)) { // Page exists // Show page include("$content"); } else { // Page doesn't exist echo '<br>'; echo '<br>'; echo '<br>'; echo 'Sorry, the page that you are trying to access does not exist.<br>'; echo 'Please return to <a href="http://www.avlscotland.com/test/index.php">AVL Scotland</a><br>'; echo '<br>'; echo 'Thank you.<br>'; } // End if page exists ?> I'm accessing the pages using links like <a class="menuactive" href="test/index.php?content=avl">Home</a> What I'm struggling to do is make the PHP look for the content files in a sub-directory. Look forward to any help you can offer. Thanks, Ross I have 3 set of pages. The first html page only contains a search textbox and a submit button which then call up the second page search.php which populate html table with search result. The third page is update.php which allows to update the records populated by search.php. The problem is that it when it update the records it automatically updates all rows in the table making all records look the same. I do not know where I have made a mistake please help. When I use phpadmin to update the records no problem as I can specifically input the cf_id number directly. Search.php code Code: [Select] <?php if(isset($_POST['submit'])){ if(isset($_GET['go'])){ if(preg_match("^/[A-Za-z]+/", $_POST['name'])){ $name=$_POST['name']; } } else{ echo "<p>Please enter a search query</p>"; } } //connect to the database $con = mysql_connect("localhost","dbusrn","dbpwd"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("mydb", $con); $name = $_POST['name']; $result = mysql_query ("select * from Customer_Registration where Firstname like '%$name%' or lastname like '%$name%' "); $row = mysql_fetch_row($result); $cf_uid = $row[0]; $Firstname = $row[6]; $lastname = $row[7]; $Address = $row[8]; $Postcode = $row[9]; $Phone = $row[10]; $Email = $row[11]; $Customer_Type = $row[12]; $Computer_type = $row[13]; $Computer_maker = $row[14]; $Model = $row[15]; $OS = $row[16]; $Appointment_date = $row[17]; $Problem = $row[18]; $Solution = $row[19]; $Comment = $row[20]; ?> <form action="updatecus.php" method="post"> <table width="100%" border="2" cellspacing="0" cellpadding="8"> <tr><td width="45%" class="FormText">Customer ID:</td> <td width="55%"><?php echo $row[0];?></td></tr> <tr><td width="45%" class="FormText">First name:</td> <td width="55%"><input name="Firstname" type="text" value="<?php echo $Firstname;?>"?> </td></tr> <tr><td width="45%" class="FormText">Last name:</td> <td width="55%"><input name="lastname" type="text" value="<?php echo $lastname;?>"?> </td></tr> <tr><td width="45%" class="FormText">Address:</td> <td width="55%"><input name="Address" type="text" value="<?php echo $Address; ?>"?> </td></tr> <tr><td width="45%" class="FormText">Postcode:</td> <td width="55%"><input name="Postcode" type="text" value="<?php echo $Postcode; ?>"?> </td></tr> <tr><td width="45%" class="FormText">Phone:</td> <td width="55%"><input name="Phone" type="text" value="<?php echo $Phone; ?>"?> </td></tr> <tr><td width="45%" class="FormText">Email:</td> <td width="55%"><input name="Email" type="text" value="<?php echo $Email; ?>"?> </td></tr> <tr><td width="45%" class="FormText">Customer:</td> <td width="55%"><input name="Customer_Type" type="text" value="<?php echo $Customer_Type; ?>"?> </td></tr> <tr><td width="45%" class="FormText">Computer :</td> <td width="55%"><input name="Computer_type" type="text" value="<?php echo $Computer_type; ?>"?> </td></tr> <tr><td width="45%" class="FormText">Manufactural:</td> <td width="55%"><input name="Computer_maker" type="text" value="<?php echo $Computer_maker; ?>"?> </td></tr> <tr><td width="45%" class="FormText">Model:</td> <td width="55%"><input name="Model" type="text" value="<?php echo $Model; ?>"?> </td></tr> <tr><td width="45%" class="FormText">Operating System:</td> <td width="55%"><input name="OS" type="text" value="<?php echo $OS; ?>"?> </td></tr> <tr><td width="45%" class="FormText">Appointment:</td> <td width="55%"><input name="Appointment_date" type="text" value="<?php echo $Appointment_date; ?>"?> </td></tr> <tr><td width="45%" class="FormText">Problem:</td> <td width="55%"><textarea name="Problem" rows="10" cols="20" ><?php echo $Problem; ?></textarea></td></tr> <tr><td width="45%" class="FormText">Solution:</td> <td width="55%"><textarea name="Solution" rows="10" cols="20" ><?php echo $Solution; ?></textarea></td></tr> <tr><td width="45%" class="FormText">Comment:</td> <td width="55%"><textarea name="Comment" rows="10" cols="20" ><?php echo $Comment; ?></textarea></td></tr> <td width="55%"><input name="submit" value="submit" type="submit" <br> <input type="Submit" value="Cancel"</br></td> </form> <?php ?> update.php code Code: [Select] <?php //connect to the database $con = mysql_connect("localhost","dbusrn","dbpwd"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("mydb", $con); //if (isset($_POST['submit'])) { $cf_id = $_POST['cf_id']; $Firstname = $_POST['Firstname']; $lastname = $_POST['lastname']; $Address = $_POST['Address']; $Postcode = $_POST['Postcode']; $Phone = $_POST['Phone']; $Email = $_POST['Email']; $Customer_Type = $_POST['Customer_Type']; $Computer_type = $_POST['Computer_type']; $Computer_maker = $_POST['Computer_maker']; $Model = $_POST['Model']; $OS = $_POST['OS']; $Appointment_date = $_POST['Appointment_date']; $Problem = $_POST['Problem']; $Solution = $_POST['Solution']; $Comment = $_POST['Comment']; if (isset($_POST['submit'])) { $query ="UPDATE Customer_Registration SET Firstname='$Firstname',lastname='$lastname',Address='$Address',Postcode='$Postcode',Phone='$Phone',Email='$Email',Customer_Type='$Customer_Type',Computer_type='$Computer_type',Computer_maker='$Computer_maker',Model='$Model',OS='$OS', Appointment_date='$Appointment_date',Problem='$Problem',Solution='$Solution',Comment='$Comment' WHERE cf_id=cf_id"or die (mysql_error()); echo $query; mysql_query($query) or die(mysql_error()); //mysql_close($con); echo "<p>Congrats Record Updated</p>"; } ?> Thank you in advance for your help I'm trying to get some code to work that will update a field to show a checkbox either checked or not checked.
The field either uses a Y or N. Y is checked, N not checked. A code that I have tried displays the correct result for the box either checked or not checked.
input type="checkbox" name="obcDisplay" value="Y" <?=($r['obcDisplay'] == 'Y') ? 'checked="checked"' : ''; ?>/>But I want the ability to change when the form is submitted. so if I bring up a page and the checkbox is checked (Y) and I submint, I want the database to update to N and the other way around. I have just upgraded PHP on my ISP server and none of the php scripts work. I was using 5.2. And I am now on 5.4. Why would the scripts stop working? Are there and patches or changes I need to make to make them work? I need an answer urgently! Hey all, I would like to know the best way to determine whether a value has been changed in a multi select transfer. For example, I have two select fields. User clicks on button to add an item to the right select element with id of select2 from the left select element with an id of select1. When they click update, it posts to a php method. This is where I am uncertain what to do. How can I check that they indeed added or removed items from the right select element and if they did, determine which ones were removed or added to make the reflected changes in the database? This is what I have, but it's bad solution because it deletes all related records before it adds the ones it finds to the right select element: Code: [Select] public function update(){ $subcategory = new Category(); $subcategory->where('id',$this->uri->segment(4))->get(); $subcategory->delete($subcategory->related_category->get()->all); $new_parents = $this->input->post('catupload'); $parent_category = new Category(); $parent_category->where_in('controller',$new_parents)->get(); $subcategory->save($parent_category->all); } This is what the form elements look like: Code: [Select] echo "You can add or remove one or many parents associated with this category:"; echo "<div class='multiselect-transfer'>"; echo form_multiselect('catadd[]',$other_cats,'','id="select1"'); echo anchor('#','add >>','id="add"'); echo "</div>"; echo "<div class='multiselect-transfer'>"; echo form_multiselect('catupload[]',$default_cats,'','id="select2"'); echo anchor('#','<< remove','id="remove"'); echo "</div>"; echo form_submit('submit','Update'); echo form_close(); $other_cats variable holds array of categories that have not been asssociated with the current category being updated when this category was first created. The $default_cats variable holds an array of categories that have been associated with the current category being updated when this category was first created. And the javascript: Code: [Select] $().ready(function() { $('#add').click(function() { return !$('#select1 option:selected').remove().appendTo('#select2'); }); $('#remove').click(function() { return !$('#select2 option:selected').remove().appendTo('#select1'); }); }); Thanks for response. Hello, I'm using curl to grab a new solar image once an hour or so from the Solar Dynamics Observatory (example below). I'm trying to archive new images and am struggling with that. If I download an image, the filetime() function returns the current time since I downloaded it and wrote it to a fresh file. The result is that the file is always "new", even if the image hasn't changed on the SDO website. Do you have an idea on how to check the last modified time of a file through curl or other means so that I'm not downloading duplicate images? Thanks a ton! //fetch image $ch = curl_init("http://www.somewebsite.com/theimage.jpg"); curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1); $file = "../images/latest/theimage.jpg"; $fp = fopen($file, "w"); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); fclose($fp); //this part is no good... //get last modified date if (file_exists($file)) { $filetime = filemtime($file); } Hi all, I created a page template at http://www.durgeshsound.com/gallery/ Here my pagination buttons are not working. this issue arises when permalink format is http://www.example.com/sample-post/ But when I set permalink format to default (www.example.com/?p=123) then it starts to work and creates a working pagination link like this http://www.durgeshso...e_id=81&paged=2. I want this format http://www.example.com/sample-post/ in the links. Please help. Hi again, Here is the code $string .= (substr($string,-1) == '-') ? '' : '-'; I know what this code does but to increase my knowledge could some one tell me what is the question mark symbol for ( ? ) and what is the colon doing. As I have seen the ? in a lot of scripts but have no clue what it does and what its used for cheers! So im using textwrangler and usually when you click on the '{' or '}' it will highlight everything inbetween them, well on the top one on line 7 it does not, and i tried messing around with it to try to get it to work cause i keep getting an error on line 8 that says "Parse error: syntax error, unexpected '{' in /home/truckste/public_html/create_topic_parse.php on line 8" Code: [Select] <?php if($username){ header("Location: index.php"); exit(); } if(isset($_POST['topic_submit'])){ if (($_POST['topic_title'] == "" && ($_POST['topic_content'] == "")){ echo "You Did Not Fill In Both Fields. Please Return To The Previous Page."; exit(); } else{ requre('scripts/connect.php'); $cid = $_POST['cid']; $title = $_POST['topic_title']; $content= $_POST['topic_content']; $creator = $_POST['uid']; $sql = "INSERT INTO topics (category_id, topic_title, topic_creator, topic_date, topic_reply_date) VALUES ('".$cid."', '".$title."', '".$creator."', now(), now())"; $res = mysql_query($sql) or die(mysql_error()); $new_topic_id = mysql_insert_id(); $sql2 = "INSERT INTO posts (category_id, topics_id, post_creator, post_content, post_date) VALUES ('".$cid."', '".$new_topic_id."', '".$creator."', '".$content."', now())"; $res2 = mysql_query($sql2) or die(mysql_error()); $sql3 = "UPDATE categories SET last_post_date=now(), last_user_posted'".$creator."', WHERE id='".$cid."' LIMIT 1"; if (($res) && (res2) && (res3)){ header("Location: view_topic.php?cid".$cid."$tid=".$new_topic_id) } else{ echo "There Was A Problem Creating Your Topic. Please Try Again."; } } ?> Hi Friends,
I wanted to know what is new in PHP version 5.6.0. How is it different from its previous versions? How will benefit the security of PHP websites?
Thanks in advance.
can you tell me whats wrong with this? Code: [Select] <?php $age= 60; if( isset($_SESSION['logedin']) ) { $q = mysql_query('SELECT id=`$id`, DATE_FORMAT(`last_activity`,"%a, %b %e %T") as `last_activity`,UNIX_TIMESTAMP(`last_activity`) as `last_activity_stamp`FROM `mymembers`WHERE `$logOptions_id` <> "'.($_SESSION['logedin']).'"'); $isonlinecheck = mysql_query($q); if ($isonlinecheck ="last_activity_stamp + $age "< time()){ $isonline = "is <font color='green'>online!</font>";} else { $isonline = "is<font color='red'> offline!</font>"; } } ?> Good evening my PHP experts!!! OK so heres the problem...I have been at this for about 2 DAYS now and for the life of me I just don't understand what I could possibly be doing wrong. I have 3 of 4 variables outputting correctly but without my id being pulled from the URL NOTHING will get written to my database. I have ran some tests and I came to learn that my $_POST['id']; function is not working properly for some strange reason. As always, any help would be greatly appreciated. Please see below PHP code. I also have posted the HTML code for your reference purposes...thanks in advance. Please helpppp!!!! Code: [Select] <?php session_start(); $id = ''; if (isset($_POST['password'])) { include_once "scripts/connect_to_mysql.php"; $id = $_POST['id']; $id = mysql_real_escape_string($id ); $id = eregi_replace("`", "", $id); $cust_password = $_POST['password']; $hashedPass = md5($cust_password); $sql = mysql_query("UPDATE customers SET password='$hashedPass' WHERE id='$id'"); $update_success = 'You have successfully updated your Password. Please click <a href="customer_login.php">HERE</a> to log into your account.'; //Output to test whether or not my variables have anything in them. //$update_success, $hashedPass, $cust_password all Output just fine. $id displays nothing at all. echo $update_success; echo $hashedPass; echo $cust_password; echo $id; exit(); } ?> <!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>Untitled Document</title> <link rel="stylesheet" type="text/css" href="style.css"/> <script type="text/javascript"> <!-- Form Validation --> function validate_form ( ) { valid = true; if ( document.form.password.value == "" ) { alert ( "Password field must not be blank." ); valid = false; } return valid; } <!-- Form Validation --> </script> </head> <body> <div id="pg_container"> <!--HEADER SECTION--> <div id="header"> <div id="header_logo"></div> <div id="header_right">Welcome to Built 2 Manage.</div> </div> <!--HEADER SECTION--> <!--PAGE CONTAINER--> <div id="pgbdy_container"> <form action="cust_acc_conf.php" method="post" id="form" name="form" enctype="multipart/form-data" onsubmit="return validate_form ( );"> <div id="login_header"> <p> Please log into your account below. </p> </div> <div id="cust_choose_pass_form"> <div id="cust_choose_pass_text"> <p> Password: </p> </div> <div id="cust_choose_pass_field"> <p> <input name="password" type="text" id="password" /><br /><br /> <input name="submit_password" type="submit" id="submit_password" value="Submit Password" /><br /> </p> </div> </div> </form> </div> <!--PAGE CONTAINER--> <div id="footer"></div> </div> </body> </html> Cant Figure Out Whats Wrong With it.. Code: Code: [Select] <?php if(isset($_SESSION['user'])) { $bb = mysql_query("SELECT * FROM main WHERE id=". $_SESSION['id']) or die ("An error has occured: " . mysql_error()); while($n=mysql_fetch_array($bb)) { ?> <div class='cs_article'> <div class='left'> <h2>User Control Panel</h2> <p><a href="usercp.php">User CP</a><?php if($n['rights'] == 1) { echo ", <a href="modcp.php">Mod CP</a>"; }?> <?php if($n['rights'] == 2) { echo ", <a href="aa/">Admin CP</a>"; }?> <div class='button'><a href='usercp.php'>Read more</a></div> </div> <div class='right'> <h1>User CP</h1> </div> </div> <?php }} ?> What its doing: Mod-Justin Compared to Mod-Justin |