PHP - Php Pdf Form Showing "array" For Drop Down Menus
Hello I have an issue with a form that has been built by someone else on Wordpress. <div class="steps"> <div class="step gap-large step-1"> <h2 class="step-title"><span class="gold">Step 1.</span> Calculate the value of your <span class="gold">gold</span></h2> [gold_calculator your-items] </div> <div class="step gap-large step-2"> <h2 class="step-title"><span class="gold">Step 2.</span> Submit your details</h2> <div class="row"> <div class="column col-xs-12 col-sm-2 col-lg-4"> <label class="required" for="sell-title">Title</label> [select* your-title id:sell-title class:form-control "Mr" "Mrs" "Miss" "Ms"] </div> <div class="column col-first-name col-xs-12 col-sm-5 col-lg-4"> <label class="required" for="sell-first-name">First Name</label> [text* your-first-name id:sell-first-name class:form-control placeholder "Enter your first name"] </div> <div class="column col-last-name col-xs-12 col-sm-5 col-lg-4"> <label class="required" for="sell-last-name">Last Name</label> [text* your-last-name id:sell-last-name class:form-control placeholder "Enter your last name"] </div> <div class="column col-xs-12 col-sm-12 col-lg-4"> <label class="required" for="sell-email">Email Address</label> [email* your-email id:sell-email class:form-control placeholder "Enter your email address"] </div> <div class="column col-xs-12 col-sm-6 col-lg-4"> <label class="required" for="sell-daytime-phone">Daytime Telephone</label> [tel* your-daytime-phone id:sell-daytime-phone class:form-control placeholder "Enter your telephone number"] </div> <div class="column col-xs-12 col-sm-6 col-lg-4"> <label class="" for="sell-mobile-phone">Mobile Telephone</label> [tel your-mobile-phone id:sell-mobile-phone class:form-control placeholder "Enter your mobile number"] </div> <div class="column col-xs-12 col-sm-6 col-lg-6"> <label class="required" for="sell-address-1">Address Line 1</label> [text* your-address-1 id:sell-address-1 class:form-control placeholder "Enter your address"] </div> <div class="column col-xs-12 col-sm-6 col-lg-6"> <label class="" for="sell-address-2">Address Line 2</label> [text your-address-2 id:sell-address-2 class:form-control placeholder "Enter your address"] </div> <div class="column col-xs-12 col-sm-12 col-lg-4"> <label class="required" for="sell-city">Town/City</label> [text* your-city id:sell-city class:form-control placeholder "Enter your town/city"] </div> <div class="column col-xs-12 col-sm-6 col-lg-4"> <label class="required" for="sell-county">County</label> [text* your-county id:sell-county class:form-control placeholder "Enter your county"] </div> <div class="column col-xs-12 col-sm-6 col-lg-4"> <label class="required" for="sell-postcode">Postcode</label> [text* your-postcode id:sell-postcode class:form-control placeholder "Enter your postcode"] </div> <div class="column col-xs-12 col-sm-12 col-lg-6"> <label class="required" for="sell-method">Choose your method of payment</label> [select* your-method id:sell-method class:form-control "Instant Bank Transfer" "Cash" "Cheque"] </div> <div class="column col-xs-12 ccol-sm-12 col-lg-6"> <div class="input-label required">Terms & Conditions</div> [acceptance your-price-acceptance id:sell-price-acceptance]I accept the price offered above for my gold.[/acceptance] [acceptance your-terms-acceptance id:sell-terms-acceptance]I accept the <a href="/terms-conditions/" target="_blank">terms & conditions</a>.[/acceptance] [acceptance your-acknowledgement id:sell-acknowledgement]I declare and acknowledge that: 1. I confirm the property enclosed is mine to sell, 2. I believe the items(s) to be genuine gold or platinum 3. You will contact me if the value calculated upon receipt differs in weight or carat 4. I accept payment will only be made to the person named on the submission form.[/acceptance] </div> <div class="column col-submit col-xs-12 col-sm-12"> <div class="alert alert-info">After clicking the ‘Submit’ button below, we'll email you a form to print off and include with the package you send to us. If you wish to be paid by bank transfer, please write your bank details on the form once printed.</div> <div class="submit">[submit class:btn class:btn-gold "Submit"]</div> </div> </div> </div> </div>
<?php /** @var \Strive\Sections\Pdf_Form $this */ ?> <head> <style> h1, h2 { margin-top: 0; } th, td { text-align: left; vertical-align: top; } .section { padding: 20px 0; } .border-top { border-top: solid 1px #E7E7E7; } .cut-top { border-top: dashed 1px #E7E7E7; } .text-placeholder { background-color: #F7F7F7; } .cut-note { text-align: center; font-size: 80%; margin-bottom: 5px; } </style> </head> <body> <h1>Step 3. Print & post this form with your gold</h1> <div class="section quote border-top"> <h2 class="section-title">Customer Quote:</h2> <div> <?php if ( $this->calculator['empty'] 😞 ?> <p>You didn't weigh your gold - don't worry, we'll do it for you and call you with an offer. </p> <?php else: ?> <ol> <?php foreach ( $this->calculator['items'] as $item 😞 ?> <li><?php echo $item['weight']; ?>g of <?php echo $item['name']; ?> - £<?php echo $item['price']; ?></li> <?php endforeach; ?> </ol> <p>Total: £<?php echo $this->calculator['total']; ?></p> <?php endif; ?> </div> </div> <div class="section details border-top"> <h2 class="section-title">Customer Details:</h2> <table width="100%"> <tr> <td width="50%"> <table width="100%"> <tr> <th>Reference:</th> <td><?php echo $this->reference; ?></td> </tr> <tr> <th>Name:</th> <td></td><?php echo empty( $this->title ) ? '' : $this->title; ?> <?php echo empty( $this->first_name ) ? '' : $this->first_name; ?> <?php echo empty( $this->last_name ) ? '' : $this->last_name; ?></td> </tr> <tr> <th>Email:</th> <td><?php echo empty( $this->email ) ? '-' : $this->email; ?></td> </tr> <tr> <th>Telephone:</th> <td><?php echo empty( $this->daytime_phone ) ? '-' : $this->daytime_phone; ?></td> </tr> <tr> <th>Mobile:</th> <td><?php echo empty( $this->mobile_phone ) ? '-' : $this->mobile_phone; ?></td> </tr> </table> </td> <td width="50%"> <table width="100%"> <tr> <th>Address 1:</th> <td><?php echo empty( $this->address_1 ) ? '' : $this->address_1; ?></td> </tr> <tr> <th>Address 2:</th> <td><?php echo empty( $this->address_2 ) ? '' : $this->address_2; ?></td> </tr> <tr> <th>Town/City:</th> <td><?php echo empty( $this->city ) ? '' : $this->city; ?></td> </tr> <tr> <th>County:</th> <td><?php echo empty( $this->county ) ? '' : $this->county; ?></td> </tr> <tr> <th>Postcode:</th> <td><?php echo empty( $this->postcode ) ? '' : $this->postcode; ?></td> </tr> </table> </td> </tr> </table> </div> <div class="section payment border-top"> <p>Preferred Payment Method: <?php echo empty( $this->method ) ? '' : $this->method; ?></p> <?php if ( $this->method === 'Instant Bank Transfer' 😞 ?> <p>Write down your bank details below for the account in which you wish funds to be deposited.</p> <table width="100%"> <tr> <th width="25%">Bank:</th> <td width="75%" class="text-placeholder"> </td> </tr> <tr> <th>Name on Account:</th> <td width="75%" class="text-placeholder"> </td> </tr> <tr> <th>Sort Code:</th> <td width="75%" class="text-placeholder"> </td> </tr> <tr> <th>Account No:</th> <td width="75%" class="text-placeholder"> </td> </tr> </table> <?php endif; ?> </div> <div class="cut-note">Print this form, include the above part in your package and post to the address below.</div> <div class="section address cut-top"> <p> SMG<br><br> <?php echo empty( $this->send_address ) ? '' : $this->send_address ?> </p> </div> </body>
any help would be appreciated. Edited July 28 by Barandcode tags added Similar TutorialsCan someone please help me with an array problem i can not figure out. I need the array to be numbered from 1 to how ever many fields that are needed in the form and have a mysql field name and the title of the field also in the array. 1, "mysql_field_name", "Title of form field" 2, "", "" and so on then the form will be shown based on the array. I have the following draft code which I am working with. any suggestions on how i may do this array ? Code: [Select] <?php $options = array( '1'=> array('fieldtext'=>'option1', 'mysqlfield'=>'option1'), '2'=> array('fieldtext'=>'option2', 'mysqlfield'=>'option2'), '3'=> array('fieldtext'=>'option3', 'mysqlfield'=>'option3'), '4'=> array('fieldtext'=>'option4', 'mysqlfield'=>'option4'), ); // $options = array(1 => "option1", "option2", "option3", "option4"); // the line above works but i want to include the name of the mysql field as well. $userid = 1; ?> <div style="align: center; margin: 12px; font-family:Tahoma;"> <br><br><?php if ($_POST['Update'] != "Update") { // check if form submitted yet, if not get data from mysql. $res = db_query("SELECT * FROM `users` WHERE `userid` = '" . $userid . "'"); foreach($options as $key => $value) { $_POST[$key] = mysql_result($res, 0, $value); } $ok_to_update = "no"; } elseif ($_POST['Update'] == "Update") { // check if form submitted yet, if so get POST data. // error checking // foreach($options as $key => $value) { // $_POST[$i] = ""; // } $ok_to_update = "yes"; } if ($_POST['Update'] == "Update" && $ok_to_update == "yes") { // $res = db_query("INSERT INTO `users` () VALUES ()"); // add user details to database. ?><p><br><br><br>Thank you for updating</p><?php } else { ?><form name="form1" method="post" action=""> <?php foreach($options as $key => $value) { ?><p><?php echo($value); ?>: <input type="text" name="<?php echo($key); ?>" value="<?php echo($_POST[$key]);?>"></p> <?php } ?> <input name="Update" type="submit" value="Update"> </form> <?php } ?> </div> Hey can anyone please help? I making this form on my website and I have two drop down lists, one is for sizes and the other is for colors. They both have an option for "other" and I'm wanting a textbox to appear when "other" is selected. I got the first drop down to work but I can't figure out how to get the second one to work without messing with the first. Here is the code I have please help: <form name="form1" method="post" action=""> <script type="text/javascript"> function showfield(name){ if(name=='Other')document.getElementById('div1').innerHTML='Other: <input type="text" name="other" />'; else document.getElementById('div1').innerHTML=''; } </script> <p>Size: <select name="size" id="size" onchange="showfield(this.options[this.selectedIndex].value)"> <option selected="selected">Please select ...</option> <option value="1' H X 6" W">2' H X 1' 6" W</option> <option value="1' H X 2' W">1' H X 2' W</option> <option value="1' H X 1' 4" W">1' H X 1' 4" W</option> <option value="Other">Other</option> </select> <div id="div1"></div> <p>Color: <select name="Color" id="Color" onchange="showfield(this.options[this.selectedIndex].value)"> <option selected="selected">Please select ...</option> <option value="Walnut Stain/Dark Brown">Walnut Stain/Dark Brown</option> <option value="Tan">Tan</option> <option value="Walnut">Walnut</option> <option value="Other">Other</option> </select> <div id="div1"></div> </p> Hi guys I'm struggling a bit, I need to replace a word that occurs multiple times in text with an array("up","down","forward","backwards") of words. $find = "left"; $replace = array("up","down","forward","backwards"); $text = "left left left left"; echo str_replace($find,$replace,$text); The Output is: array array array array Did try this with a foreach statement as well, but no luck. Is there a better way of doing this? Thanks I am currently creating a form and I want to populate a drop down selection menu with data from two fields in a form. For example, I want it to pull the first and last name fields from a database to populate names in a drop down menu in a form. I want the form to submit to the email address of the person selected in the drop down. Is this possible to do? The email is already a field in the record of the person in the database. Can anyone give me some pointers or advice on how I should go about setting up the "Select" box drop down? I am not sure how to code it to do what I am wanting. Any links to relevant help would be appreciated too. Thanks in advance! Hi, bit stuck on how to find and replace "<" and ">" with "<" and ">". I basically have a database record that outputs to screen and I need the code in the <code> tags to be rendered to the screen. I therefore need it to go through the whole array variable from the db and change the symbols just inside the code tags. Please be aware that the code tags might happen more than once here's an example below Code: [Select] <p>blah blah blah</p> <p>blah blah blah</p> <p>blah blah blah</p> <code> <h1>hello</h1> </code> <p>blah blah blah</p> <p>blah blah blah</p> <p>blah blah blah</p> <code> <h1>hello</h1> </code> the desired output would be: <p>blah blah blah</p> <p>blah blah blah</p> <p>blah blah blah</p> <code> <h1>hello</h1 </code> <p>blah blah blah</p> <p>blah blah blah</p> <p>blah blah blah</p> <code> <h1>hello</h1 </code> help on this would be great Cheers Rob Code: [Select] elseif(isset($_GET['search'])){ $search=$_POST['search']; $search=str_replace(" ", "+", $search); header("Location: ./index.php?q=".$search); } elseif(isset($_GET['q'])){ $search=$_GET['q']; $keywords=explode("+",$search); $sql10000="SELECT product_id FROM $tbl_name2 WHERE "; while($query10000=each($keywords)){ $sql10000.="keyword LIKE '%".$query10000."%' OR"; } $sql10000=substr($sql10000,0,(strLen($sql10000)-3)); $content=$sql10000; That is returning this: SELECT product_id FROM keywords WHERE keyword LIKE %Array% For some reason it's showing "Array", it should be looping through the keywords array. Hi guys I am a newbie with PHP and I have been trying to solve this problem for 3 days.. Ive set up a booking form on my website to be sent directly to my email once the client clicked on the send button.. The problem I am having while checking these pages on wamp is that the booking form is ok but when I click on the send button the following message error appears "Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\fluffy_paws\booking_form2.php on line 27" When I check online I have this message "500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed." Are my codes wrong??? My webhosting is Blacknight.com , Im on Windows Vista, my internet is a dongle with O2 ireland Thanks for your help! This happens from time to time and it really drives me crazy. I cannot get the problem to reproduce, although I have plenty of evidence that it is happening. I have a php page that pulls in some database from mssql formats it in a nice table then send via email to a 3rd party. All of that works great. What happens is in some of the emails the first column will show the table cell information for the next column. See example: Code: [Select] Mascaw Mar. 8, 2012 - 6:15 pm Ronnie Johnson Newtown Pike<td width="150"> Mar. 8, 2012 - 6:15 pm Todd Doe Hall of Justice Mar. 8, 2012 - 6:15 pm Carol French I had this problem before with another emailing system and found that wrapping the email to 900 before sending it out fixed it. I wrapped this with $message = wordwrap($message, 900, "\n", true);() but it doesn't seem to make a difference. Anyone ran into this before? Any help would be greatly appreciated! Thanks cant work out this mysql syntax error "operation":"medupdate","medid":"","name":"ibo","medyear":"5","medmonth":"21","medday":"1","recuser":1,"SuccFail":"fail","SuccFailMessage":"error occured You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '''WHERE med_id=' at line 2","ResultData":""} Code: [Select] $sql="update metodology set med_description='".$req['name']."', med_year='".$req['medyear']."', med_month='".$req['medmonth']."', med_day='".$req['medday']."', med_recorddate= now(), med_recorduserid= 1'"; $sql.= " WHERE med_id=".$req['medid']; Hello, If i have a title like "It's Wonderful!" it always gets displayed as "It?s Wonderful!" and the ? is always in a black diamond. How can i get it to show a ' properly? Thanks I am getting the following error when using composer: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? Just started. I am pretty sure composer.json wasn't changed. journalctl doesn't show anything. Maybe Doctrine related, however, nothing seems to help.
Any ideas? [michael@devserver www]$ php -v PHP 7.3.4 (cli) (built: Apr 2 2019 13:48:50) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.4, Copyright (c) 1998-2018 Zend Technologies with DBG v9.1.9, (C) 2000,2018, by Dmitri Dmitrienko [michael@devserver www]$ composer -V Composer version 1.4.2 2017-05-17 08:17:52 [michael@devserver www]$ yum info composer Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.us.oneandone.net * epel: mirror.rnet.missouri.edu * extras: mirror.us.oneandone.net * remi-php73: mirror.bebout.net * remi-safe: mirror.bebout.net * updates: mirror.us.oneandone.net Installed Packages Name : composer Arch : noarch Version : 1.8.4 Release : 1.el7 Size : 1.8 M Repo : installed From repo : epel Summary : Dependency Manager for PHP URL : https://getcomposer.org/ License : MIT Description : Composer helps you declare, manage and install dependencies of PHP projects, : ensuring you have the right stack everywhere. : : Documentation: https://getcomposer.org/doc/ [michael@devserver www]$ composer update Loading composer repositories with package information Updating dependencies (including require-dev) [ErrorException] "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]... [michael@devserver www]$
This topic has been moved to Linux. http://www.phpfreaks.com/forums/index.php?topic=318175.0 I have a registration form on my website and after Registration I want the user to activate first his account. I don't have problem on sending this email to the user. What I want to appear is like this.. GoodDay "username", Blah Blah! how can you actually do that? I know that you can do that through session variables but the thing is email's can't accept scripts on sending emails. how can I get the value from a session variable for example and convert it to plain html text so that i can OUTPUT it to the email.. HELP PLEASE! Hi, I currently have an if, elseif, else program that starts off with Code: [Select] if( $v_name == "" || $v_msg == "" ) echo "something" how do I turn this into a switch? but the very next elseif I have Code: [Select] elseif( strcspn( $_REQUEST['msg'], '0123456789' ) == strlen( $_REQUEST['msg'] ) ) echo "something" is it possible to turn this into a switch with 2 different strings like that to evaluate? This topic has been moved to PHP Installation & Configuration. http://www.phpfreaks.com/forums/index.php?topic=347922.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=326600.0 Hi all, just to get this out of the way i have now been working on html / css / php / mysql coding for about 3 weeks. So i dont know too much, on to the problem... I am creating a database for asset managment in and out of our shop I have setup the db and it works with no issues. So I am currently trying to add fluff as i put it. The guys in the shop want the web page to have a table of information on what is in the shop and when they click on the asset number in the table they want it to open a new page where you can edit the database information of that item. I have no clue how to emplement this after reading diffrent ideas for about 4 hours today I am just stuck and confused. any ideas or tips would be helpfull This first block of code is my status page. Code: [Select] <style> tr {font-size:24px;} button {width:120px} </style> <body topmargin="50px"> <?php session_start(); include("../../Connections/db_connection.php"); $table = "shop_inventory"; mysql_select_db("$db_database", $connect); unset ($db_username, $db_password); $currenttime = getdate(); $result = mysql_query("SELECT * FROM shop_inventory WHERE In_Shop='1'"); $test = mysql_fetch_array($result); echo "<table border='1' align='center' style='text-align:center' cellpadding='10' width='100%'> <tr> <th>Asset number</th> <th>Building</th> <th>Room number</th> <th>In date</th> </tr>"; $_SESSION['array_row'] = $test; while($row = mysql_fetch_array($result)) { $style = ''; //if ($currenttime - $row['Entered_Shop_Time'] == 0 || 1) $style = 'style="background-color:#00FF00"'; echo "<tr>"; echo "<td> <button onClick=../subpages/edititems.php>" . $row['Asset'] . "</button> </td>"; echo "<td>" . $row['Building'] . "</td>"; echo "<td>" . $row['Room_Number'] . "</td>"; echo "<td $style>" . date("F j, Y", strtotime($row['Entered_Shop_Time'])) . "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($connect); ?> </body> This second block of code is the page where i want to dump the table info into for editing. Code: [Select] <?php session_start(); include("../../Connections/db_connection.php"); $table = "shop_inventory"; mysql_select_db("$db_database", $connect); unset ($db_username, $db_password); //$Asset = $_POST['Asset']; $Session = $_SESSION['array_row']; //$data = mysql_query("SELECT * FROM shop_inventory WHERE Asset=$session"); //$query = mysql_query($data) or die ("Cannot select database." . mysql_error()); //$Session = mysql_fetch_array($data); ?> <!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>Add Items</title> </head> <body> <div style=" padding-top:5px;"> <h1><center>Add New Items</center></h1> </div> <form name="myForm" action="afteredititems.php" method="post"> Asset Number: <input type="text" name="Asset" value="<?php echo $Session['Asset']?>"/><br /><br /> Manufactu <input type="text" name="Manufacture" value="<?php echo $Session['Manufacture']?>"/><br /><br /> Model: <input type="text" name="Model" value="<?php echo $Session['Model']?>"/><br /><br /> Serial Number: <input type="text" name="Serial_Number" value="<?php echo $Session['Serial_Number']?>"/><br /><br /> Building: <input type="text" name="Building" value="<?php echo $Session['Building']?>"/><br /><br /> Room Number: <input type="text" name="Room_Number" value="<?php echo $Session['Room_Number']?>"/><br /><br /> <input type="hidden" name="In_Shop" value="1"/> Type of Equipment: <select name="Type" value="<?php echo $Session['Type']?>"> <option value="desktop">Desktop</option> <option value="laptop">Laptop</option> <option value="ipad">Ipad</option> <option value="ipod">Ipod</option> <option value="projector">Projector</option> <option value="printer">Printer</option> </select><br /> <br /> <center><input type="submit" value="Add Item"/></center> </form> </body> </html> And lastly I have a page that redisplays the edited information. Code: [Select] <?php //$Asset = $_POST['Asset']; //$data = mysql_query("SELECT * FROM shop_inventory WHERE Asset=$Asset"); //$query = mysql_query($data) or die ("Cannot select database." . mysql_error()); //$data2 = mysql_fetch_array($data); include("../../Connections/db_connection.php"); $table = "shop_inventory"; mysql_select_db("$db_database", $connect); unset ($db_username, $db_password); $Asset = $_POST['Asset']; $Manufacture = $_POST['Manufacture']; $Model = $_POST['Model']; $Sn = $_POST['Serial_Number']; //<---- possibly fubar check sn everywhere $Building = $_POST['Building']; $Room_Number = $_POST['Room_Number']; $Type = $_POST['Type']; $data = mysql_query("UPDATE `shop_inventory` SET Manufacture='$Manufacture', Model='$Model', Serial_Number='$Sn', Building='$Building', Room_Number='$Room_Number', Type='$Type' WHERE Asset=$Asset"); //$query = mysql_query($data) or die("could not execute query.". mysql_error()); ?> <!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> </head> <body> <!-- display changes --> Asset: <?php echo $Asset ?><br /> Manufactu <?php echo $Manufacture ?><br /> Model: <?php echo $Model ?><br /> Serial number: <?php echo $Sn ?><br /> Building: <?php echo $Building ?><br /> Room Number: <?php echo $Room_Number ?><br /> Type: <?php echo $Type ?><br /><br /> </body> </html> I know there is a lot of poorly formated code and more then likely it is hard to read as I was going to do cleanup after I had all my features working. After doing all the digging i found out about sessions and how they are used to pass data, I thought it would be a good method but I just could not figure out how to send information from the table if the table is reciving its info from an array. any help would be appreciated thanks. Hi Guys, I need help I have setup a code recently : this is the code : $za['MIN(spec_positionid)'] and it gave me an error saying : Cannot use object of type stdClass as array but if I change to this : $za->spec_positionid it works, but I need to get the MIN value from the database. can someone please help. this is very urgent for me..... Hi there, Does anyone know how to select from a mutlidimensional array, and put the results in a new array? I figured it out but it takes a long time. My array is huge (over 1000+ items) and this search is performed about 50 times before loading the page. My array is called $tasks and it looks like this Code: [Select] $tasks=Array( [0]=>array([id]=>"12"; [owner]=>"nancy"; [task]=>"clean the house"); [1]=>array([id]=>"23"; [owner]=>"toby"; [task]=>"do homework"); [2]=>array([id]=>"43"; [owner]=>"dan"; [task]=>"take out trash"); [3]=>array([id]=>"32"; [owner]=>"nancy"; [task]=>"cook dinner"); ) I want to be able to select from $tasks where owner="nancy", so i end up with this Code: [Select] $nancy_tasks=array( [0]=>array([id]=>"12"; [owner]=>"nancy"; [task]=>"clean the house"); [1]=>array([id]=>"32"; [owner]=>"nancy"; [task]=>"cook dinner");) )Thank you!!! Hi all, Using a form with check boxes divided into different categories, I collect data selected by the user. I now want to combine each choice in each category with each choice in the other categories and list the combinations to the user. If the user chooses one or more options in each category, it is relatively easy to nest foreach loops, since the number of categories will always be the same. For example, if the form contains three categories of options, the code will be: Code: [Select] foreach ($form['cat_1'] as $k1 => $val1) { foreach ($form['cat_2'] as $k2 => $val2) { foreach ($form['cat_3'] as $k3 => $val3) { echo $val1.' _ '.$val2.' _ '.$val3.'<br/>'; } } } Things get complicated if the user does not select options within a given category. More generally, I want to be able to generate the list regardless of the number of categories in which the user selects options. Thank you in advance for your advice. |