
turpentyne
Members-
Posts
220 -
Joined
-
Last visited
Everything posted by turpentyne
-
I've gotten to this, if I did it right. (changed to session instead of regular variable) I'm confused on one thing though. I was worried about what Russelreal said, but not sure how to take only one in the php code below? Or does it essentially take just one? if ((isset($_POST['how1'])) && (!empty($_POST['how1'])) ){$_SESSION['s_how1'] = mysql_escape_string($_POST['how1']);} elseif ((isset($_POST['resident']) && (!empty($_POST['resident'])) ){$_SESSION['s_how1'] = mysql_escape_string($_POST['resident']); } else {$_SESSION['s_how1'] = "0"} EDIT: correction, I wasn't reading what Russelreal said right. But don't want to edit the above, since people have probably read it by now.
-
Simple one, I think. I just want to know if this is how I would do this code. on page one a javascript toggles between two divs depending on the option made in a select box. Div one is a radio button valued "dc resident" and the other is a text box where they enter some text. Then on page two, whichever one is entered becomes the variable to insert to my database. if (isset($_POST['how1']){$how1 = mysql_escape_string($_POST['how1']);} elseif (isset($_POST['resident']){$how1 = mysql_escape_string($_POST['resident']); }; I think it's right, but something in my gut tells me its not, or that maybe there's a simpler way to do this?
-
Gah!!! I appologize immensely! I think I had a gremlin issue going on here. PMF's suggestion seemed perfect. It was the first thing I tried. When it didn't work, I went (and led everyone else) on a wild goose chase. I knew something wasn't right with the direction we were going, but I'm not experienced enough to be sure. I went back to a file version with PMF's suggestion, and it worked perfectly. I don't know if there was an issue with uploading the file or what. but it did actually solve the problem. Sorry if I was overly nebulous on explaining that it was indeed arrays I was dealing with. I got side tracked looking into other solutions, when CPD took it back to a basic POST query insert. Sorry 'bout that. problem solved.
-
Reading up on extract, it sounds like it's an insecure way? I can still just create the variables. but on the previous page, it's looping through form fields that would have the same name. Now that's sounding like a potential problem? Basically its: Class 123: student 1's fname, lname,bday, etc. student 2's fname,lname,bday, etc. Class 456" student 3's fname,lname,bday, etc. The way it's written, I believe this means there are three bits of info for fname, lname, bday and so on. Maybe this is why he was creating an array? Forgive my ignorance. I've never had to work with anything more than a simple form query insert. I tried what you explained above, and it only enters the first student. the other two are never entered. I assume... the reason for the loop?
-
Just tried that change. Still put in the empty extra row. hmmm Any thoughts on how I can go about this? I was hoping not to have to rewrite the code, but if there's an easy way to go about it. Sucks trying to figure out somebody else's work. If it helps any, I can show you the mess on the previous page that generates the data posted to the page above. <? /*code above this for credit card transaction, and depositing session data in the table. I added that because he had it originally going into the tables on each successive page, and people were backtracking and putting in duplicate entries. grrr. //$query_selectAllItems = "SELECT *, DATE_FORMAT(workshop_date, '%e-%m-%Y') as 'my_date' FROM tbl_workshops"; $query_selectAllItems = "SELECT * FROM tbl_registration_workshop, tbl_workshops where tbl_registration_workshop.registration_id=$reg_id and tbl_registration_workshop.workshop_id !='0' and tbl_registration_workshop.workshop_id = tbl_workshops.workshop_id"; @$result_all = mysql_query($query_selectAllItems); @$numRows_all = mysql_num_rows($result_all); //output each row while ($c_row = mysql_fetch_array($result_all)){ ?> <tr><td colspan="9"><b><?= $c_row['workshop_title'] ?></b></td></tr> <tr><td colspan="9"><br /><br /></td></tr> $count = $c_row['regworkshop_qty']; $i = 1; while ($i <= $count) { $i++; /* the printed value would be $i before the increment (post-increment) */ $x = $i-1 ?><tr><td colspan=4><b><?= $reg_id ?> Enrollee #<?= $x ?></b><img src="/images/greenblack.gif" style="height:2px; width:450px;position:relative;left:5px;top:-3px;"></td></tr> <tr><td align=right style="padding-right:4px;">First Name</td><td style="padding-right:10px;"><input type="text" name="fname[]" id="fname" onfocus="this.className='reg_live';" onblur="this.className='reg_off';" /></td> <td align=right style="padding-right:4px;">Last Name</td><td><input type="text" name="lname[]" id="lname" onfocus="this.className='reg_live';" onblur="this.className='reg_off';" /></td></tr> <tr><td align=right style="padding-right:4px;">Email</td><td style="padding-right:10px;"><input type="text" name="email[]" onfocus="this.className='reg_live';" onblur="this.className='reg_off';" /></td> <td align=right style="padding-right:4px;">Phone</td> <td style="padding-right:10px;"><input type="text" name="phone[]" onfocus="this.className='reg_live';" onblur="this.className='reg_off';" /></td> </tr> <tr><td align=right style="padding-right:4px;">Birthdate</td> <td colspan=3> <select id="birth_month" name="bdate2[]" onfocus="this.className='reg_live';" onblur="this.className='reg_off';" > <option value="">month</option> <option value="01">Jan</option> <option value="02">Feb</option> <option value="03">Mar</option> <option value="04">Apr</option> <option value="05">May</option> <option value="06">Jun</option> <option value="07">Jul</option> <option value="08">Aug</option> <option value="09">Sept</option> <option value="10">Oct</option> <option value="11">Nov</option> <option value="12">Dec</option> </select> <select id="birthday" name="bdate[]" onfocus="this.className='reg_live';" onblur="this.className='reg_off';" > <option value="">day</option> <option value="01">01</option> <option value="02">02</option> <option value="03">03</option> <option value="04">04</option> <option value="05">05</option> <option value="06">06</option> <option value="07">07</option> <option value="08">08</option> <option value="09">09</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option> <option value="30">30</option> <option value="31">31</option> </select> <select id="birthyear" name="bdate3[]" onfocus="this.className='reg_live';" onblur="this.className='reg_off';" > <option value="">year</option> <option value="1993">1993</option> <option value="1994">1994</option> <option value="1995">1995</option> <option value="1996">1996</option> <option value="1997">1997</option> <option value="1998">1998</option> <option value="1999">1999</option> <option value="2000">2000</option> <option value="2001">2001</option> <option value="2002">2002</option> <option value="2003">2003</option> <option value="2004">2004</option> <option value="2005">2005</option> <option value="2006">2006</option> <option value="2007">2007</option> <option value="2008">2008</option> <!--<option value="2009">2009</option> <option value="2010">2010</option> <option value="2012">2012</option> <option value="2013">2013</option> <option value="2014">2014</option> <option value="2015">2015</option> <option value="2016">2016</option> <option value="2017">2017</option> <option value="2018">2018</option> <option value="2018">2019</option> <option value="2018">2020</option>--> </select> <input type="hidden" value="<?= $c_row['workshop_id'] ?>" name="wid[]" /><input type="hidden" name="reg_id" value="<?= $reg_id ?>" onfocus="this.className='reg_live';" onblur="this.className='reg_off';" /></td> </tr><tr><td colspan="4"><br /><br /></td></tr> <? } ?> <tr><td colspan="4"><br /><hr style="color: #000;background-color: #000;height: 5px;"><br /></td></tr> <? } //end while ?> <tr><td colspan="4"><input type="hidden" name="reg_id" value="<?= $reg_id ?>" /><input type="hidden" name="reg_id" value="<?= $reg_id ?>" /> <input type="hidden" name="reg_alone" value="<?= $reg_alone ?>" /> <input type="submit" value="Register" /></form></td></tr> </table>
-
To answer your questions, it isn't actually my code. I've taken over somebody else's unfinished project. On previous pages the user selects several classes and how many students they're putting in each. Then on this page it generates a loop of fields for each class to enter info for each student. They hit submit and it adds the students to the table. So, yes that's multiple inputs, if I'm understanding right? I'm at a lower php level, and struggle to understand how to work with arrays and loops, so I'm not sure what's going on. I can answer any questions to the best of my ability. edit: or maybe I should not say lower level? if this isn't even written well
-
Can anyone tell me what's making this code put an extra entry in the database?Whatever the number of looped students being added, it adds another row with nothing but the registrationid entered. <?php // connect to database include("databaseconn.php"); // store all posted intemnos and descriptions in local arrays $fname = $_POST['fname']; $lname = $_POST['lname']; $phone = $_POST['phone']; $email = $_POST['email']; $bdate = $_POST['bdate']; $bdate2 = $_POST['bdate2']; $bdate3 = $_POST['bdate3']; $wid = $_POST['wid']; $rid = $_POST['reg_id']; $reg_alone = $_POST['reg_alone']; $_SESSION['workshops']=$wid; ?> <? if(sizeof($_POST['fname'])) { // loop through array $number = count($fname); for ($i=0; $i<=$number; $i++) { // store a single item number and description in local variables $fnames = $fname[$i]; $lnames = $lname[$i]; $phones = $phone[$i]; $emails = $email[$i]; $bdates = $bdate[$i]; $bdates2 = $bdate2[$i]; $bdates3 = $bdate3[$i]; $wids = $wid[$i]; $rids = $rid[$i]; echo "echod ".$bdates2."and<br>"; print_r($bdates2); $query_insertItemWorkshop = "INSERT INTO tbl_attendees (attendee_fname, attendee_lname, attendee_registrationid, workshop_id, attendee_email, attendee_telephone, attendee_bday, attendee_bmonth, attendee_byear) VALUES ('$fnames', '$lnames', '$reg_alone', '$wids', '$emails', '$phones', '$bdates', '$bdates2', '$bdates3')"; echo "query: ".$query_insertItemWorkshop; $dberror = ""; $ret = mysql_query($query_insertItemWorkshop); } } ?>
-
aha! a dollar sign was missin!
-
odd glitch... I put that script on page one, found a couple of brackets and such that weren't closed. no big deal. The form comes up without errors. I paste the same exact script on page two, and I get "Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/workshop/public_html/register2test.php on line 8" I'm not seein' it.. but then, I'm just now starting my own cup of coffee! <?php session_start(); $pageList = array( 1 => 'http://www.website.org/registertest.php', 2 => 'http://www.website.org/register2test.php', 3 => 'http://www.website.org/register3test.php', 4 => 'http://www.website.org/register4test.php'); $pageNum = 1; if (isset($_SESSION['page_num'])){ if($_SESSION['page_num'] < $pageNum){ header('location: {pageList[$_SESSION["page_num"]]}'); } else{ $_SESSION['page_num'] = $pageNum; } } //rest of page ?>
-
I have a form on page 1 that submits to page 2, then on to page 3, 4 and 5. On each page more data is collected, then page 5 puts it all into its respective place in the database. I'm trying to prevent a duplicate entry from someone hitting the back button, and I've seen suggestions to do it with sessions and a uniqid. I'm not versed in sessions, so my first question is, because I'm not submitting to the same page, where do I put the session? on page 2 or page one? Right now, on page one, all I have is: <?php session_start(); include("dbconnection.php"); ?> <!-- a bunch of javascript form validation, html code and the form --> <?php $unique_id = uniqid (rand (),true); $_SESSION['unique_id']=$unique_id; ?> <form name="register1" class="registration_form" method="post" action="register2test.php" target="_self" onsubmit="return myForm()"> <input type="hidden" name="unique_id" id="unique_id_form" value="<?php echo $unique_id; ?>" > <input type="submit" value="Submit" class="buttontype"/> </form> on page two, I'm assuming, it's something similar to... <?php session_start(); if (isset($_POST["submit"])) { if ($_POST["unique_id_form"] == $_SESSION["unique_id"]) { $_SESSION["unique_id"] = ''; /*set variables here ? */ } else echo 'error'; } else { $_SESSION["unique_id"] = uniqid (rand (),true); ?>
-
So, bear with me while I type this out to think it through for a minute, and get corrections/suggestions/whoah nellies and so on... Sorry if it's a jumbled mess. just trying to wrap my head around something new... On page one, I leave my posted form as is, but add in a hidden field that is a generated unique id like this? <?php $unique_id = uniqid (rand (),true); ?> <input type="hidden" name="unique_id" id="unique_id" value="<?php echo $unique_id; ?>" > <input type="submit" value="Submit" class="buttontype"/> </form> I would then take the insert query that's on registration page 2 and move it to page 4 where they enter the kids name...generating session variables something like... $fname = $_POST['fname']; $lname = $_POST['lname']; $address = $_POST['address']; $phone = $_POST['phone']; $email = $_POST['email']; $wid = $_POST['wid']; $unique_id = $_POST['unique_id']; $datetime = date('Y-m-d H:i:s'); $_SESSION['fname']=$fname; $_SESSION['lname']=$lname; $_SESSION['address']=$address; $_SESSION['phone']=$phone; $_SESSION['email']=$email; $_SESSION['wid']=$wid; $_SESSION['datetime']=$datetime; $_SESSION['unique_id']=$unique_id; On page two there is also a subtotal/add a discount/total owed form? Can I just add these as more variables to the session? On page three, where I'm... I start the page with sessions, but do I need to do anything else? Redeclare the session variables, or are they taken care of? Not sure how this part works, really. And when they hit the back button, does(or, how does) that uniqid cover me for a resubmit, or refreshing page one, entering the data and trying again? <?php session_start(); ?> // I assume I add this at top, then give them the subtotal/add a discount code form? <form id="yet_another_form"></form> Page three is still passing the payment variables to the authorize.net code on page 4... I think it'd be nice to have that taken care of on page 3, to Muddy_Funster's point ... but one problem at a time, I suppose. so on page four, I'm assuming I break out the session variables into regular variables again?? session_start(); if (isset($_SESSION['fname'])) { $fname = $_SESSION['fname']; } if (isset($_SESSION['lname'])) { $lname = $_SESSION['lname']; } / * and so on */ // then the query insert finally happens, written same as originally? $query_insertItem = "INSERT INTO tbl_registration (reg_fname, reg_lname, reg_address, reg_address2, reg_city, reg_state, reg_zip, reg_phone, reg_fax, reg_email, reg_how, reg_how_detail, reg_dc, photo_release, reg_timestamped) VALUES ('$fname', '$lname', '$address', '$address2', '$city', '$state', '$zip', '$phone', '$fax', '$email', '$hear', '$how', '$res', '$released', '$datetime')"; $dberror = "";
-
I've run into a little bit of a logistical nightmare on some registration pages I've taken over work on. On these pages, parents register their kids for classes. The pages have been coded as such: page one: the user enters name and personal info, and selects one or two classes to register for, on submit, they go to page two. page two: their info is entered into the mysql database's registration table on a unique id The user verifies the total, enters a discount and submits page three: credit card info is added to registration table, and sent to authorize.net. page four: payment processed, and they enter the data for their kids into the attendees table page five: confirmation and done. My issue is that, at first I saw people entering page one data, going to page two, then for some reason, hitting the back button. They could then enter the data again. I'd have two entries in the registration table for the same person. I was going to put some sort of unique key on the name and an email, but then I saw scenario two... Another person enters data and registers one kid.. then for whatever personal reason goes back and registers a second kid in a completely separate transaction. So I can't put that key on there, but is there a way to prevent them from going back and reentering twice. I don't want to have to blow up the code to do it at the end of everything. and that would take implementing sessions, wouldn't it? I'm not so versed at that. Any thoughts?
-
I'm putting a unique key on a table over three columns, and I'm curious what the size field is for? Is this how many characters are checked? I was hoping I could use something like that to only check the first so many characters of a datetime field to see if the same date matches but ignore the hour,minutes,seconds.
-
Is there a more simplified way of doing a query conditional based on 2 possible options (or more?). If I remember right, there's an operator in javascript that does this simplification. right now I have: if (isset($_POST['print_change']) && ($_POST['print_change'] = "no")){ $query_print = "UPDATE tbl_registration SET reg_hardcopied = '0' WHERE reg_id = '$id_printed'"; mysql_query($query_print); } elseif (isset($_POST['print_change']) && ($_POST['print_change'] = "yes")){ $query_print = "UPDATE tbl_registration SET reg_hardcopied = '1' WHERE reg_id = '$id_printed'"; mysql_query($query_print); }
-
ah! never mind. the wysywyg is generating a <p> tag around things.
-
I'm working on a site where I've implemented a simple back end wysiwyg editor for content on a page. Then on the public page I run a php query to pull that content and display it. But doing this cancels out the css I have been using to split content into two columns. Is there a way to do this in php, or is there a way to circumvent the problem? ( also tried echoing the entire css style along with the query result - that didn't work either) The <p id='container_sub'> is what is split into two columns. I tried it outside of the query, and inside the query around where I echo results. Neither worked. Here's the basic php code, and further down the css that makes two columns: <?php $pageid = '2'; // Formulate Query // This is the best way to perform an SQL query // For more examples, see mysql_real_escape_string() $query = sprintf("SELECT content FROM tbl_pages WHERE page_id='%s'", mysql_real_escape_string($pageid)); // Perform Query $result = mysql_query($query); // Check result // This shows the actual query sent to MySQL, and the error. Useful for debugging. if (!$result) { $message = 'Invalid query: ' . mysql_error() . "\n"; $message .= 'Whole query: ' . $query; die($message); } // Use result // Attempting to print $result won't allow access to information in the resource // One of the mysql result functions must be used // See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc. while ($row = mysql_fetch_assoc($result)) { echo "<p id='container_sub'>".$row['content']."</p>"; } // Free the resources associated with the result set // This is done automatically at the end of the script mysql_free_result($result); ?> The css.... #container_sub {-moz-column-count: 2; -moz-column-gap: 25px; -webkit-column-count: 2; -webkit-column-gap: 20px; column-count: 2; column-gap: 20px;} #container_sub2 {-moz-column-count: 2; -moz-column-gap: 25px; -webkit-column-count: 2; -webkit-column-gap: 20px; column-count: 2; column-gap: 20px;}
-
my client changed their mind, and wants a field in the database that toggles to 'printed' if they've printed. I had a simple javascript that generates a button: <style type="text/css" media="print"> @page { size:8.5in 11in; margin: 1cm } .printbutton { visibility: hidden; display: none; } </style> <script> document.write("<input type='button' " + "onClick='window.print()' " + "class='printbutton' " + "value='Print This Page'/>"); </script> But I'm assuming I ought to do this with php - or would it be jquery? , so that when they click the button, I can do a query update to the database. But I can't find any tutorials on it. Searching for it, just brings up the php command, "print" grrr.
-
unfortunately that's the first thing I tried, and I got the error: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/workshop/public_html/admin/viewregistrations2.php on line 145 which stumped me because it looks like its the same syntax being used isn't it?
-
Another issue with trying to work on somebody else's script (and on no sleep!) I've got this mess of a page I'm trying to manipulate to add a feature to. When somebody goes to this page, it pulls all records. At the top, I added a way to refine the results by dates. That query works fine, I tested it in mysql. To avoid fighting with the original code, I created an if statement to create $query_selectAll. But when I put it in the page, it would just refresh with the same data. I echoed the query to make sure it is correct. Then I realized that there was another query, $query_selectAllItems, further down the page that was generating the results, and none of what I was doing made a difference. But I'm not sure why it's ignoring my query or how to work around this. I tried deleting the query $query_selectAllItems, thinking it would take mine, because it ends with the same: $result_all $result_all = mysql_query($query_selectall); or $result_all = mysql_query($query_selectAllItems); <?php require_once('calendar/classes/tc_calendar.php'); include("include/auth.php"); include("include/conn.php"); @$a_row = mysql_fetch_array($result); // I added this if statement in to get my POST results, without having to make changes to the GET results he made. if (isset($_POST['view'])){ $view=$_POST['view']; } else { $view=$_GET['view']; } if ($view=="All") { $query_selectall = 'select * from tbl_registration'; echo $query_selectall; } elseif ($view=="dated") { $mydate = isset($_REQUEST["date5"]) ? $_REQUEST["date5"] : ""; $end_date = isset($_REQUEST["date6"]) ? $_REQUEST["date6"] : ""; $query_selectall = "SELECT * FROM tbl_registration WHERE reg_timestamped BETWEEN STR_TO_DATE('$mydate', '%Y-%m-%d') AND STR_TO_DATE('$end_date' , '%Y-%m-%d')"; echo $query_selectall; } else { $query_selectall = "select * from tbl_registration where category='$view'"; echo $query_selectall; } $result_all = mysql_query($query_selectall); @$numRows_all = mysql_num_rows($result_all); ?> <title>WYF Admin</title> <html> <head> <script language="javascript" src="calendar/calendar.js"></script> <link href="include/styles.css" rel="stylesheet" type="text/css"> <SCRIPT language="JavaScript"> <!-- function confirm_delete(idval) { var verify= confirm("Do you really want to delete this Registration?"); if (verify== true) { window.location="delete_registrations.php?action=delete&did=" + idval; } } //--> </SCRIPT> <script type="text/javascript" src="js/jquery-latest.js"></script> <script type="text/javascript" src="js/jquery.tablesorter.js"></script> <script type="text/javascript"> $(function() { $("table").tablesorter({debug: true}); }); </script> </head> <body leftmargin="0" rightmargin="0" bottommargin="0" topmargin="0" cellspacing="0" cellpadding="0" bgcolor="ffffff"> <table width="100%"><tr><td align="left"><img src="images/logo.jpg"></td></tr> <tr><td><hr></td></tr> </table> <table><tr><td valign="top"> <table cellspacing="1" cellpadding="0" bgcolor="#cccccc" border="0" width="300"> <tr><td> <table cellspacing="0" cellpadding="0" width="300" height="400" bgcolor="#ffffff" border="0"> <tr><td align="left" valign="top"> <table width="250"><tr><td valign="top"> <b>Welcome </b><br><br> <?php //$query_selectAllItems = "SELECT *, DATE_FORMAT(workshop_date, '%e-%m-%Y') as 'my_date' FROM tbl_workshops"; $query_selectAllItems = "SELECT * FROM tbl_registration"; $result_all = mysql_query($query_selectAllItems); $numRows_all = mysql_num_rows($result_all); ?> <? include "include/nav.php"; ?> </td></tr></table></center> </td></tr> <tr><td></td></tr></table></tr></td></table> </td><td valign="top"> <div style="float:left;padding-right:40px;"><a href="getcsv.php">export to csv</a></div><div> <div style="float:right;margin-right:100px;"><form name="form1" method="post" action="viewregistrations2.php"><div style="float:left;overflow:visible;padding-right:10px;">View between</div> <div style="float:left;overflow:visible;padding-right:10px;"> <?php $myCalendar = new tc_calendar("date5", true, false); $myCalendar->setIcon("calendar/images/iconCalendar.gif"); $myCalendar->setDate(date('d'), date('m'), date('Y')); $myCalendar->setPath("calendar/"); $myCalendar->setYearInterval(2000, 2015); $myCalendar->dateAllow('2008-05-13', '2015-03-01'); $myCalendar->setDateFormat('j F Y'); $myCalendar->setAlignment('left', 'bottom'); $myCalendar->setSpecificDate(array("2011-04-01", "2011-04-04", "2011-12-25"), 0, 'year'); $myCalendar->setSpecificDate(array("2011-04-10", "2011-04-14"), 0, 'month'); $myCalendar->setSpecificDate(array("2011-06-01"), 0, ''); $myCalendar->writeScript(); ?> </div> <div style="float:left;overflow:visible;padding-right:10px;"> and </div> <div style="float:left;overflow:visible;padding-right:10px;"> <?php $myCalendar = new tc_calendar("date6", true, false); $myCalendar->setIcon("calendar/images/iconCalendar.gif"); $myCalendar->setDate(date('d'), date('m'), date('Y')); $myCalendar->setPath("calendar/"); $myCalendar->setYearInterval(2000, 2015); $myCalendar->dateAllow('2008-05-13', '2015-03-01'); $myCalendar->setDateFormat('j F Y'); $myCalendar->setAlignment('left', 'bottom'); $myCalendar->setSpecificDate(array("2011-04-01", "2011-04-04", "2011-12-25"), 0, 'year'); $myCalendar->setSpecificDate(array("2011-04-10", "2011-04-14"), 0, 'month'); $myCalendar->setSpecificDate(array("2011-06-01"), 0, ''); $myCalendar->writeScript(); ?> </div> <div style="float:left;overflow:visible;padding-right:10px;"><input type="hidden" name="view" id="view" value="dated"><input type="submit" value="go!"> </div></form> </div><br><br><br><br> <table width="95%" border="1" cellpadding="3" cellspacing="1" bordercolor="#999999" id="rowspan" class="tablesorter" name="table"><thead> <tr bgcolor="#ffffff"> <th width="125">Name</th> <th width="125">Address</th> <th width="125">Phone</th> <th width="125">Email</th> <th width="125">Workshop</th> <td width="50"> </td> <td width="50"> </td><td> </td> </tr></thead> <tbody> <? //output each row while ($c_row = mysql_fetch_array($result_all)){ ?> <tr> <td><?= $c_row['reg_fname'] ?> <?= $c_row['reg_lname'] ?></td> <td><?= $c_row['reg_address'] ?></td> <td><?= $c_row['reg_phone'] ?></td> <td><?= $c_row['reg_email'] ?></td> <td> <?php $catid = $c_row['reg_workshopid']; $query="SELECT * FROM tbl_workshops where workshop_id = '$catid'"; //Run query; $result=@mysql_query($query); $row=mysql_fetch_array($result); ?> <?php echo($row['workshop_title']); ?> </td> <td width="50" bgcolor="#DEE1EB"><div align="center"><a href="edit_registration.php?id=<? print $c_row['reg_id'] ?>">edit</a></div></td> <td width="50" bgcolor="#DEE1EB"><div align="center"><a href="javascript://" onClick="confirm_delete(<? print $c_row['reg_id'] ?>); return false">delete</a></div></td> <td width="50" bgcolor="#DEE1EB"><div align="center"><a href="printregistration.php?regid=<? print $c_row['reg_id'] ?>">view all / print</a></div></td> </tr> <? } //end while ?> </tbody> </table><br><br> </td></tr></table>
-
hmmm... not today's date? I'm trying to convert $table_row['workshop_date'] which is 2012-12-02 into a date. I'll have to look through that first link, and see if I can understand
-
Does anybody know how to take the queried standard date format - 2012-04-02 for example - and print it to the page as April 2, 2012? Or at the very least, to switch to 04-02-2012? Trying to find some tutorials online.
-
yeah... sadly, that decision was out of my control.
-
ok.. that shows cURL and simpleXML is enabled. Which means I'm back to square one. gah!
-
I've hit a six-foot-thick brick wall and have no idea what to do. Trying to integrate for payments and this is a scary new realm for me Hopefully somebody here can help me figure this out, as I'm a complete and utter newbie on shopping carts etc. Authorize.net has been no help, and they say "we have no developers" on staff to answer questions. I'm getting an error 13 and nothing gets around it. The basic result is that an error 13 occurs when the API id and transaction key are incorrect (but they are) or if the 'gateway URL' is incorrect. I've checked and it is. But they also say its in the in the cURL section of the code and if this is wrong, it could generate the error. No idea where that's supposed to be. did a search. Question: To install, test, etc, it looks like I need something called cURL extensions and SimpleXML enabled. I don't know if this is, and the client's hosting company has not gotten back to me (hosted out of country, too). I looked for a php.ini file, and see nothing. Is it safe/possible to put my own php.ini file on the html_public folder? If so, how do I set up the cURL and SimpleXML extensions? (Assuming this is even contributing to the problem) And any help beyond this is greatly appreciated, if you've worked with authorize.net integration.
-
I must be missing something simple. I've got this little script that pulls rows from the database to populate a dropdown. If one of them matches a predetermined variable, then I want it to show selected. It's... almost working. The dropdown prints, and shows the options. But the selected item shows separate, printed just below the dropdown? Here's what I've got: <?php $quer3=mysql_query("SELECT discount_id, discount_name,discount_amount FROM tbl_discount order by discount_amount"); echo " <select name='discount_id'><option value=''>Select</option>"; while($row = mysql_fetch_array($quer3)) { if($row[discount_id]==$discount_id){echo "<option selected value='".$row[discount_id]."'>".$row[discount_name]." / $".$row[discount_amount]."</option>";} else{echo "<option value='$row[discount_id]'>$row[discount_amount]</option>";} echo "</select>"; } ?>