PHP - Checkbox Issue Wont Show Unchecked
Hi,
I just cannot seem to get this to work, have been testing and searching all morning and not getting anywhere. I have a form with a series of checkboxes which populates the MySqL database, this works fine. Trying to print the results from the form if the row is empty show an unchecked checkbox, if there is a value show a checked checkbox. I have tested my if statement and can echo correctly wether empty or not empty, just cannot get the checkbox to be unticked if there is no value in the row Code: [Select] while ($row = mysql_fetch_array($qry, MYSQL_BOTH)) { // show total fields for debugging // $totalfields = mysql_num_fields($qry); // print ($totalfields) ; // if ( ! empty ( $row ['acid_wash'] ['neutralise'] ['clean'] ) ) { if ( ! empty ( $row ['clean'] ) ) { ///if it's 1 (true) then we add 'checked' to a variable we will use in the input //to cause it to be checked $checked = 'checked'; // test if row has data echo "full"; }else{ //if the value is 0 (false) we set the variable to be empty, not checked $checked = ''; // test for no value echo "empty" ; } To Display Result: <tr> <td>High Pressure Clean <input style='font-size:10px;' name='clean[]' type='checkbox' checked='$checked'></td> </tr> The empty and full test echos do seem to work, showing me the if statement works. The problem is even when the row is empty the checkbox shows checked.... Thanks. Similar TutorialsHi I have an array of checkboxes whose values if checked can be updated in mysql. The code I have below accomplishes that just fine. On my form I have: print "<form method='post' action='update.php'>\n"; /////// mysQL query here $myID = $itemRow['myID']; $chk = $itemRow['item_shipped'] == 1 ? 'checked' : ''; echo "<input type=checkbox name=cbox[] value='{$itemRow['myID']}' $chk>"; echo"</form>"; The above code displays various items with a checkbox next to them. So if that checkbox is checked the code below stores that in mysql. On my update.php page I have: if(sizeof($_POST['cbox'])) { //means if at least one check box is selected foreach($_POST['cbox'] AS $id) { mysql_query("UPDATE om SET item_shipped ='1' WHERE myID=$id"); } //end foreach } //end IF The problem is though i can check a checkbox and store that value '1' in mysql, I have no way of unchecking an already checked checkbox and storing the '0' in mysql. Can anyone help? Thanks in advance i have an html form which is a "post" on it i have an array of checkboxes and a sumbit button, once button is clicked i go to another page where i handle those boxes checked the problem now is if NO checkboxes are checked and i hit the submit...i get errors on the other page my code: foreach($product_names as $product_row) { ?> <tr> <td > </td><td width='200px'><?php echo $product_row->getName(); ?></td> <td width='200px'><input type="checkbox" name="graphic[]" value="<?php echo $product_row->getId();?>" /></td> <td width='200px'><input type="checkbox" name="text[]" value="<?php echo $product_row->getId();?>" /></td> </tr> <?php } ?> </table> <table> <tr> <td> <input type='submit' name='submit' value='Submit'> <?php if ( (isset($graphic)) || (isset($text) )) { echo "checkboxes checked"; //show submit button } else { //hide submit botton and echo "no boxes check"; } ?> the above is NOT working please help???? database.php Hey everyone,
Calling all web devs, so here is my problem from the gecko. I am currently using a free flux theme. The problem is that it has a rss feed news box. I have phpbb forums and i used the link and it wont show. I'm not sure why i did alot of research and it seems it happens because my forums use a php based feed. I do not know how to merge it with the default rsslib.php file that is already there or how to even begin to edit it so it displays correctly on the page. Below is the theme I'm currently using along with a screenshot of the coding for the rsslib.php.
Theme used - Free Flux Green Theme
Screenshots The index.php importing the rsslib.php coding Spoiler everything seems to be working fine except the form wont show up. the site is here http://davisgutierrez.com/testing_area/form.php <?php if($_POST['formSubmit'] == "Submit") { if(empty($_POST['formName'])) { $errorMessage .= "<li>You forgot to enter your Name.</li>"; } if(empty($_POST['address'])) { $errorMessage .= "<li>You forgot to enter your address.</li>"; } if(empty($_POST['city'])) { $errorMessage .= "<li>You forgot to enter your city.</li>"; } if(empty($_POST['state'])) { $errorMessage .= "<li>You forgot to enter your state.</li>"; } if(empty($_POST['zip'])) { $errorMessage .= "<li>You forgot to enter your zip code.</li>"; } if(empty($_POST['phone'])) { $errorMessage .= "<li>You forgot to enter your phone number.</li>"; } if(empty($_POST['email'])) { $errorMessage .= "<li>You forgot to enter your email.</li>"; } } $varformName = $_POST['formName']; $varaddress = $_POST['address']; $varcity = $_POST['city']; $varstate = $_POST['state']; $varzip = $_POST['zip']; $varphone = $_POST['phone']; $varemail = $_POST['email']; //generated by fatcow $link = mysql_connect(''); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; $db_selected = mysql_select_db("learnphp"); if (!$db_selected) { die(' blast!' . mysql_error()); } if(!empty($errorMessage)) { echo("<p>There was an error with your form:</p>\n"); echo("<ul>" . $errorMessage . "</ul>\n"); } $fs = fopen("memberdata.csv","a"); fwrite($fs,$varformName . ", " . $varAddress . ", " . $varCity . "," . $varState . "," . $varZip . "," . $varPhone . "," . $varEmail . "," . "/n"); fclose($fs); //header("Location: thankyou.html"); exit; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <meta http-equiv="Content-type" content="text/html;charset=UTF-8"> <head> <title>membership test</title> </head> <body> <?php if(!empty($errorMessage)) { echo("<p>There was an error with your form:</p>\n"); echo("<ul>" . $errorMessage . "</ul>\n"); } ?> <form action="form.php" method="post" name="ohta_membership_application" > Name: <input type="text" name="formName" maxlenghth="45" value="<?=$varformName;?>" /> Address: <input type="text" name="address" maxlenghth="4" value="<?=$varAddress;?>" /> City: <input type="text" name="city" maxlenghth="4" value="<?=$varCity;?>" /> State: <input type="state" name="state" maxkength="2" value="<?=$varState;?>"> Zip: <input type="text" name="zip" maxlenghth="4" value="<?=$varZip;?>" /> Phone: <input type="text" name="phone" maxlenghth="4" value="<?=$varPhone;?>" /> Email: <input type="text" name="email" maxlenghth="4" value="<?=$varEmail;?>" /> <input type="submit" name="formSubmit" value="Submit" /> <input type="reset" name="reset" value="Reset" > </form> </body> </html> Hello: I'm trying to figure out how to NOT show emailed results if the checkbox is empty (not checked). I only want it included in the message of the email if the checkbox was checked. It is writing the data to the email properly, but it is including some of the code as well. This is my email code: Code: [Select] mail( "me@digital.com", "Sign-up Sheet Request", "Date Sent: $myDate\n Parent's Name: $ParentsName Best Phone: $BestPhone Email: $Email Student's Name: $StudentsName Student's School: $StudentsSchool\n\n if(trim($SATTest1) != \"\" ) { echo \"$SATTest1\"; } ", "From: $Email" ); The "$SATTest1" data is displaying properly in the emails, but so is some of the code. Like this: Code: [Select] if(trim(Reading and Math Classes for March 10) != "" ) { echo "Reading and Math Classes for March 10"; } Any idea how to correct this? Thanks! Hello,
I want to show checkbox is checked when there is entry of that id in a table in my database.
I have 2 tables page and access_level. I am getting data from page table and displays it in <ul><li> tag with checkbox to select all or only few. After selecting the checkbox, i will store only selected checkbox value in access_level table along with table id. Page link and page name details will be stored in page table.
Now if i want to edit , i should display all the pages which is there in page table and i should also mark checked to those which are already stored in access_level table.
I am using LEFT OUT JOIN, It displays all the pages. But it is not displaying the check mark to those which are already selected.
Here is my code
<?php $s1 = mysql_query("SELECT pages.page_id, pages.code, pages.page, pages.href, access_level.aid, access_level.page_id as pgid, access_level.department, access_level.position, access_level.active FROM pages LEFT OUTER JOIN access_level ON pages.page_id=access_level.page_id WHERE access_level.department=".$department." AND access_level.position=".$position." AND pages.code='sn'") or die(mysql_error()); while($s2 = mysql_fetch_array($s1)) { ?> <tr><td><li><?php echo $s2['page']; ?> </td><td><input type="checkbox" name="sn[]" value="<?php echo $s2['page_id']; ?>" <?php if($row['pgid'] === $s2['page_id']) echo 'checked="checked"';?> />here is my pages table pages.JPG 26.55KB 0 downloads access_level access_level.JPG 19.09KB 0 downloads In access_level table i do not have page ids 8 and 9. But i want to display that also from pages table and for 1 to 7 and 10 i should display check mark. How i can achieve this? Please Help hello, i have table that store p_id , p_name , p_visible. in my form code i put this : $sql = "select * from pages"; $rslt = connect($sql); print "<form name='links' method='GET' action='checks/check_links.php'>"; while ($links = mysql_fetch_array($rslt)) { print "<input type='checkbox' name='pagename' value='1'>$links[p_name]<br>"; } print "<input type='submit' value='update'></form>"; my question is.... how to pass the query string that hold: 1. if checkbox checked, then pass value 1 to my sql query 2. i have to define witch value has need to go to the right p_name please help. I'm currently developing a website which allows users to register and log into the system to read news articles in RSS form.
A subscription page with a list of checkboxes (like CNN, BBC etc) is provided for the users to choose which news site they want to include in their customized RSS feed page.
I successfully stored the checkbox values in array form into the database. For example, if the user ticks "CNN", "BBC", "ABC News", the values that will be stored in database will be: cnn, bbc, abc
Since I'm a beginner in web coding, especially in PHP and MYSQL, I have two questions here.
Q1. How can I retrieve the stored values and display it on the subscription page with the specific checkboxes checked based on user's subscription? For instance, if the user already subscribed to CNN, when he logs into the system next time, he should be able to see the already-ticked CNN checkbox.
Q2. How can I retrieve the stored values and put it onto the customised RSS page? It's something like: if cnn is selected, then add http://rss.cnn.com/r...ition_world.rss. Is there any tutorial on that?
Last but not least, forgive me for asking so many questions in one go in this lengthy piece and thanks for all the replies in advance! =)
Table structu
HTML for checkboxes:
<input type="checkbox" name="subs[]" value="mal-malins"> The Malaysian Insider</option> <input type="checkbox" name="subs[]" value="mal-malaymo"> The Malay Mail Online</option> <input type="checkbox" name="subs[]" value="mal-star"> The Star</option> <input type="checkbox" name="subs[]" value="mal-nst"> New Straits Times</option>Code for storing the checkbox values: //START: Subscription if(isset($_POST['subscribe'])){ if(isset($_POST['subs'])){ try { $data= $_POST['subs']; $subs = implode(",", (array)$data); $stmt = $db->prepare("UPDATE members SET subs = :subs WHERE username = '$username' "); $stmt->execute(array( ':subs' => $subs )); //show success message echo '<div class="alert alert-success"><a class="close" data-dismiss="alert">×</a>Subscription updated!</div>'; //else catch the exception and show the error. } catch(PDOException $e) { $error[] = $e->getMessage(); } } else { echo '<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a>You have not selected any subscription!</div>'; } } //END: Subscription Hey basically i'm working on a multi checkbox way to delete messages stored in "crew_messages", i'm getting the error message "Unknown column 'Array' in 'where clause'" from the following code and i'm unsure as to why Code: [Select] if (isset($_POST["submit2"]) == "DELETE SELECTED") { for($i=0;$i<count($_POST["chkColor"]);$i++) { if(trim($_POST["chkColor"][$i]) != "") { $rawr = $_POST['chkColor']; $sql = "DELETE FROM crew_messages WHERE id = $rawr"; mysql_query($sql) or die(mysql_error()); } } } the check box itself Code: [Select] <input type="checkbox" name="chkColor[]" value="27"> any clues? cheers hi, i am showing an error when i submit a form and a checkbox is not checked. here is the line that is giving me the error. any fix for this? Error Code: [Select] Notice: Undefined index: billable in E:\Website\portal\mobile\editreport.php on line 14 Code Code: [Select] if($_POST['billable'] == "ON") { $pbillable = "1"; } else { $pbillable = "2"; } Even though i am getting an error, it still updates my database with a number 2. Hi, I have a set of checkboxes a bit like a checklist and I then want the items that aren't checked to displayed. On the first page, I have this code: <? while($row = mysql_fetch_array($result)) { ?> <form action="packed.php" method="post"> <div> <label><input type="checkbox" name="<? echo stripslashes($row['checklistitem']); ?>" value="yes"> <? echo stripslashes($row['checklistitem']); ?> </label> </div> This basically takes an array from a database. The info is then posted to the next page which hopefully will display the boxes which are 'unticked' or unchecked if you will. The code I have on the second page is: <?php $query_string = ""; if ($_POST) { $kv = array(); foreach ($_POST as $key => $value) { $kv[] = "$key"; } $query_string = join("<br />", $kv); } else { $query_string = $_SERVER['QUERY_STRING']; } echo $query_string; ?> At the moment, it returns the array items that were checked but I want the unchecked ones to be shown. Is that possible? Thanks very much! -Steve Hi,
I have some show/hide links like this:
<a href="javascript:ReverseDisplay('content1')" class="hide-show-button">show</a> <a href="javascript:ReverseDisplay('content2')" class="hide-show-button">show</a> <a href="javascript:ReverseDisplay('content3')" class="hide-show-button">show</a> <a href="javascript:ReverseDisplay('content4')" class="hide-show-button">show</a>using this code: var click = 0;If I click one link, it shows the content and then shows "hide" which is correct. However, if I click another link, it shows the content, but displays "show" until I click it again, so I end up in a strange loop. Is there a way I can have each of the link always display "show" when not collapsed and "hide" when collapsed? Thanks! i need help trying to get this delete feature to work its not deleting from the database (by the way i took out my database names and passwords at the top of the file) is it possible someone could help me, ive been working on this for like a week and cant figure out the problem. thanks! you can email me at spr_spng@yahoo.com picture 2.png is showing what it looks like Code: [Select] <?php $host="localhost"; // Host name $username="username"; // Mysql username $password="password"; // Mysql password $db_name="database_name"; // Database name $tbl_name="table_name"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name"; $result=mysql_query($sql); $count=mysql_num_rows($result); ?> <style> /*table affects look of the whole table look */ table { margin-left: auto; margin-right: auto; border: 1px solid #330000; border-collapse:collapse; width:70%; border-width: 5px 5px 5px 5px; border-spacing: 1px; border-style: outset outset outset outset; border-color: #330000 #330000 #330000 #330000; border-collapse: separate; background-color: #330000; #800517 f535aa #330000 school color #9A0000 school color2 #991B1E school color3 #CCCC99 school color4 #9A0000 } /*th is table header */ th { text-align: left; height: 2.5em; background-color: #330000; color: #FC0; font-size:1.5em; } /*td is table data or the cells below the header*/ td { text-align: left; height:1.0em; font-size:1.0em; vertical-align:bottom; padding:10px; border-width: 5px 5px 5px 5px; padding: 8px 8px 8px 8px; border-style: outset outset outset outset; border-color: #9A0000 #9A0000 #9A0000 #9A0000; background-color: #CCCC99; -moz-border-radius: 0px 0px 0px 0px; } </style> <table width="400" border="0" cellspacing="1" cellpadding="0"> <tr> <td><form name="form1" method="post" action=""> <table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td bgcolor="#FFFFFF"> </td> <td colspan="4" bgcolor="#FFFFFF"><strong>Pick Which Rows you want to delete, Then press delete.</strong> </td> </tr> <tr> <td align="center" bgcolor="#FFFFFF"><strong>Id</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Name</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Lastname</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Email</strong></td> <td align="center" bgcolor="#FFFFFF">delete</td></tr> <?php while($rows=mysql_fetch_array($result)){ ?> <tr> <td bgcolor="#FFFFFF"><? echo $rows['id']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['name']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['lastname']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['email']; ?></td> <td align="center" bgcolor="#FFFFFF"><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<? echo $rows['id']; ?>"></td> </tr> <?php } ?> <tr> <td colspan="5" align="center" bgcolor="#FFFFFF"><input name="delete" type="submit" id="delete" value="Delete"></td> </tr> <? // Check if delete button active, start this // edited if($delete){ for($i=0;$i<$count;$i++){ $del_id = $checkbox[$i]; $sql = "DELETE FROM $tbl_name WHERE id='$del_id'"; $result = mysql_query($sql); } // if successful redirect to delete_multiple.php if($result){ echo "<meta http-equiv=\"refresh\" content=\"0;URL=delete_multiple.php\">"; } } mysql_close(); ?> </table> </form> </td> </tr> </table> I want to show a cookie of a referral's username on a sign up page. The link is like this, www.mysite.com/signup?ref=johnsmith. The cookie doesn't show if I go to that url page. But it does show up once I reload the page. So I'm wondering if it's possible to show the cookie the first time around, instead of reloading the page? Here is my code. // This is in the header $url_ref_name = (!empty($_GET['ref']) ? $_GET['ref'] : null); if(!empty($url_ref_name)) { $number_of_days = 365; $date_of_expiry = time() + 60 * 60 * 24 * $number_of_days; setcookie( "ref", $url_ref_name, $date_of_expiry,"/"); } else if(empty($url_ref_name)) { if(isset($_COOKIE['ref'])) { $user_cookie = $_COOKIE['ref']; } } else {} // This is for the sign up form if(isset($_COOKIE['ref'])) { $user_cookie = $_COOKIE['ref']; ?> <fieldset> <label>Referred By</label> <div id="ref-one"><span><?php if(!empty($user_cookie)){echo $user_cookie;} ?></span></div> <input type="hidden" name="ref" value="<?php if(!empty($user_cookie)){echo $user_cookie;} ?>" maxlength="20" placeholder="Referrer's username" readonly onfocus="this.removeAttribute('readonly');" /> </fieldset> <?php }
I am displaying rows from a database onto a page using: while($row=mysql_fetch_array($query)){ echo $row['name']; } I need to figure out how to limit the rows shown to the page to 100. And if there are 100 rows on the page, a link will be displayed at the bottom, that says "Next 100". Then this will display the next 100 rows. Can you give an example how to do this please? Thanks Hi, I would like to do the following but not sure how. If the you/user is on index.php of http://www.domain.com/ show one page If not show another How would I do this? Thanks Hi , I know my code sucks but i'm learning fast!! I'm trying to show a form if the qty value in a database == 10 or a different form if the value ==20. I tried but failed. Any help really appreciated. Code: [Select] <?php require_once('Connections/book.php'); ?> <?php $colname_cardpayment = "-1"; if (isset($_GET['orderid'])) { $colname_cardpayment = (get_magic_quotes_gpc()) ? $_GET['orderid'] : addslashes($_GET['orderid']); } mysql_select_db($database_book, $book); $query_cardpayment = sprintf("SELECT * FROM cards WHERE orderid = '%s' ORDER BY qty ASC", $colname_cardpayment); $cardpayment = mysql_query($query_cardpayment, $book) or die(mysql_error()); $row_cardpayment = mysql_fetch_assoc($cardpayment); $totalRows_cardpayment = mysql_num_rows($cardpayment); // Database connect $con = mysql_connect("mysql1.myhost.ie","admin_book","root123"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("book_test", $con); //Parse Values from Coupon.php Form $orderid = mysql_real_escape_string(trim($_POST['orderid'])); $name = mysql_real_escape_string(trim($_POST['name'])); $surname = mysql_real_escape_string(trim($_POST['surname'])); $add1 = mysql_real_escape_string(trim($_POST['add1'])); $add2 = mysql_real_escape_string(trim($_POST['add2'])); $town = mysql_real_escape_string(trim($_POST['town'])); $county = mysql_real_escape_string(trim($_POST['county'])); $postcode = mysql_real_escape_string(trim($_POST['postcode'])); $phone = mysql_real_escape_string(trim($_POST['phone'])); $email = mysql_real_escape_string(trim($_POST['email'])); $letterstyle = mysql_real_escape_string(trim($_POST['letterstyle'])); $sql="INSERT INTO custdetails (orderid, name, surname, add1, add2, town, county, postcode, phone, email, letterstyle) VALUES ('$orderid','$name','$surname','$add1','$add2','$town','$county','$postcode','phone','$email','$letterstyle')"; if (!mysql_query($sql)) { die('Error: ' . mysql_error()); } ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Digital Scribe Books</title> <link href="style.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } </script> </head> <body onload="MM_preloadImages('images/buttons/home_over.png','images/buttons/books_over.png','images/buttons/cards_over.png','images/buttons/letters_over.png')"> <div id="snow"> <div id="wrapper"> <div id="header"> <div id="logo"><img src="images/digital_scripe.png" width="218" height="91" /></div> <div id="menu"><a href="index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Home','','images/buttons/home_over.png',1)"><img src="images/buttons/home_act.png" name="Home" width="131" height="132" border="0" id="Home" /></a><a href="books.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Books','','images/buttons/books_over.png',1)"><img src="images/buttons/books_act.png" name="Books" width="131" height="132" border="0" id="Books" /></a><a href="cards.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Cards','','images/buttons/cards_over.png',1)"><img src="images/buttons/cards_act.png" name="Cards" width="131" height="132" border="0" id="Cards" /></a><a href="letters.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Letters','','images/buttons/letters_over.png',1)"><img src="images/buttons/letters_act.png" name="Letters" width="131" height="132" border="0" id="Letters" /></a></div> </div> <div id="content"> <?php echo 'Order ID is : '. $orderid . '.<br />'; if ($row2['qty'] == 10) echo "<div> <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="accounts@agraphics.ie"> <input type="hidden" name="lc" value="IE"> <input type="hidden" name="item_name" value="10 Christmas Cards"> <input type="hidden" name="item_number" value="<? echo $orderid; ?>"> <input type="hidden" name="amount" value="12.99"> <input type="hidden" name="currency_code" value="EUR"> <input type="hidden" name="button_subtype" value="services"> <input type="hidden" name="shipping" value="2.99"> <input type="hidden" name="return" value="http://www.digitalscribe/thanks.php"> <input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted"> <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"> </form> </div>"; if ($row2['qty'] == 20) echo "<div> <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="accounts@agraphics.ie"> <input type="hidden" name="lc" value="IE"> <input type="hidden" name="item_name" value="20 Christmas Cards"> <input type="hidden" name="item_number" value="<? echo $orderid; ?>"> <input type="hidden" name="amount" value="21.99"> <input type="hidden" name="currency_code" value="EUR"> <input type="hidden" name="button_subtype" value="services"> <input type="hidden" name="shipping" value="2.99"> <input type="hidden" name="return" value="http://www.digitalscribe/thanks.php"> <input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted"> <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"> </form> </div>"; ?> </div> <div id="footer" class="clear"><div id="sign"><div id="sign_text">Personalised<br /> Books</div> </div></div> </div></div> </body> </html> <?php mysql_free_result($cardpayment); ?> Why isn't this working? elseif($db_password==md5($password)) |