Allows Someone To Change The Given Attribute Via A Pick-list
I have a form that lists query results (members, attributes) side by side, and allows someone to change the given attribute via a pick-list. I'd like to know how all of the member attributes (one for each member listed in the query results) can be updated at once. I have no problem implementing this when just one record is being updated, but as soon as there is more than one record I get into trouble. Here's a little diagram of what I'm trying to do:
------------------------------------------
Name | Attribute
------------------------------------------
Member1 | Pick List
Member2 | Pick List
Member3 | Pick List
" etc " | " etc "
------------------------------------------
| Update |
View Complete Forum Thread with Replies
Related Forum Messages:
How To Use A Value From A Pick List?
I'd like to have a form that does the following: User picks a site from a dropdown list from a MySQL db (that works - code below, thanks to all those on the web who posted code for this). Once the value is selected, a second query is run using the site as the 'where' clause and the results are displayed back to the user. mysql, php, htlm noob. I think once I get this bit, I'll be able to move forward with more interesting and complex code. ps - if this message shows up 3 times, my apologies but I've been having trouble posting. <html> <body> <?php // connect to db $db = mysql_connect("localhost"); mysql_select_db("test",$db); // build query $sitequery = "SELECT site from sitedata order by site"; // generate result set $siteresult = mysql_query($sitequery); // use results echo "Select a site from the list below: <br><br><select name='site'>"; while($siterow = mysql_fetch_array($siteresult)) echo "<option value='".$siterow["site"]."'>".$siterow["site"]."</option>"; echo "</select></td>"; ?> </body> </html>
View Replies !
Dynamic Pick List
I have been developing programs in perl and oracle and have recently switched to php. I need to create a form that has four of five seperate pick list on it. Each item in each of the pick list depend on the users previous entry. For instence if the user picks Ford then Taurus, Ranger, Focus,.etc show up in the next pick list then the user picks Ranger and 2 wheel drive, 4 wheel drive, etc show in the next pick list box on so on. I know how to this if the screen is refresed after each user entry. What I would like to fugure out how to make the screen automatically update each pick list and not refreshing the whole screen.
View Replies !
Pick And Choose List
You have two list boxes on a page. On the left are all the choices, the right box is empty. In the middle you have "arrow buttons". A single one pointing right says "move the selected choice into the right box". A single pointing left does the opposite. A double pointing right says "move all choices from left to right". A double pointing left does the opposite. I am not sure if I can do this with PHP. Maybe Javascript? Or is it just impossible to do with web pages?
View Replies !
Identifying User's Pick From Selection List
I have an application that uses PHP to access a MySQL table and extract rows which match the user's search entry. Data from the matching rows are loaded into an HTML selection list, and the user can scan the list and highlight a selected item. My question: In PHP, what is the syntax for identifying which row is highlighted? My goal is to pass the unique row ID of the selected item to a subsequent form where all the fields will be displayed for the user to edit. I already have the code that loads the selection list and the code that displays the fields. I just need to know how to determine the highlighted item. I have two PHP books, and both discuss loading the selection list, but there is no mention of what to do next.
View Replies !
Random Attribute Change
is it possible with php to change a file's attribute randomly between 2 dates? For instance, get a date between 01-01-2007 and 17-07-2007 and use that date to change a file's creation date? If it's possible it would be great in a batch ofcourse, like batching an entire folder, changing attributes of 1000 files by hand is quite difficult.
View Replies !
Pick From A Drop Down List That Automatically Gives Options In A Second Dropdown Box
does anyone know how to create a form that allows the user to firstly pick from a drop down list that automatically gives options in a second dropdown box. eg. 'category1' is selected from dropdown box 1, this then populates dropdown box 2 with the options 'category1.a' or 'category1.b' or if 'category2' is selected from dropdown box 1 then dropdown box 2 gives the options of 'category2.a' or 'category1.b' i f any one knows how I should code this please help, if not point me in the direction of a tutorial that can.
View Replies !
Change List Value In Form
I want to have in a form a list element that gives you the opportunity to choose between "taken" and "not taken". At the beginning the list value is on "not taken". What I want know is that when a costumer clicks on the list value taken and then submits the form that then the web page will be updated so that the next visitor who visits the page sees that that item has already been "taken". Code:
View Replies !
PHP To Pick A Table
In my attempt to be more organized I setup my database like this: DB: -Table1 -Table2 -Table3 -Table4 and each table has 4 forms for information.
View Replies !
How To Pick The Closest Number
I've been wondering about this for a few days. I have an array containing 4 numbers: $listofnumbers = array(0,15,30,45); Then there's a variable that could contain any number between 0 and 59. $actualtime = date('i'); Using the above I want to find out which of the numbers in the array is numerically closest to the value of $actualtime. So if $actualtime = 34 then I want to return the number 30 if $actualtime = 11 then I want to return the number 15 etc. I'm sure there's a simple solution but can't figure it out.
View Replies !
Gmail Does Not Pick Up Sender Id
I had a shared hosting account with Godaddy earlier. I have script in my code which sends automatic emails to users when they sign up on the website. All these emails were going in a proper format earlier. When i changed to Virtual Dedicated Server on Godaddy, emails which are automatically being shot to yahoo, hotmail or any other accounts are going properly. Code:
View Replies !
Pick Records Between Dates
I have this table id_hotel | ratesin | ratesout | rate 1 | 2007-06-07 | 2007-07-15 | 100.00 1 | 2007-09-07 | 2007-12-10 | 150.00 2 | 2007-05-07 | 2007-08-10 | 150.00 3 | 2007-04-07 | 2007-09-10 | 120.00 What I want to do is to make a selection and show only records between desired dates, example: If I post via form: id_hotel = 1 ratesin=2007-07-07 and ratesout=2007-07-10, the result will show only the records in those dates range in this case the result will be: id_hotel | ratesin | ratesout | rate 1 | 2007-06-07 | 2007-07-15 | 100.00 Maybe is easier than I think, how to achieve this.
View Replies !
Need A 'pick A Date' Script
where I can find a good, quick, clean script to provide a calendar from which the user can pick a date to populate a field? Ideally Im looking for a small pop-down as aprt of a larger page wide data form.
View Replies !
Checkbox Problem, He Always Pick The Variable Of The Last One
I have currently 2 awards in the database, with this script i pick them out of the database and define if they are selected and if the user unselect it then pass a variable to the database. Now it works almost good except that the script always looks to the 2nd award(last one), if the 2nd one is unselected then it updates award 1 and award 2 as unselected, when i unselect the 1st award and select the 2nd award then he updates the database with both selected(1st one and 2nd one), so the problem is that he always listening to the 2nd(last) variable/award. Does someone have a solution for this problem because i cant figure it out, greatly appreciated. PHP Code:
View Replies !
How Can I Pick All Checked Value In Action Page?
I have a dynamic category list, I have printed those list with check box in the form. I have to check those boxes and submit. How can I pick all checked value in action page? Right now only one value passing from several check boxes while several check boxes checked. Code:
View Replies !
Pick Apart Post Variable Names
i am dynamically creating a list of checkboxes for each job title in a db. the checkbox array names are something like 'job2quest[]' & the 'job5quest[]'... since i dont necessarily kno which jobs will appear, i dont want to hardcode the variables when the form is submitted. is there a way to pick apart post variable names, so the script can find the checkbox arrays?
View Replies !
Getting URL Attribute
Ass you have already guessed by my questions im not a PHP expert. Basically my two questions are. im linking to a page talk.php?id=12 How can i get the attribute from the URL in my PHP page? and also im getting a date string from the database which look like this 1147517086 Is there any method that can format this datestamp into English?
View Replies !
XML - Sorting By Attribute
I'm not sure whether this is a question about php or xml or what to be honest - a poke in the right direction would be much appreciated... I'm storing news articles in XML format. newsitems.php which contains the XML looks like this; ....
View Replies !
Attribute Is Bool, Int, Etc.
I am trying to document a class attribute in this format: Attribute: Description (data type : default value) Example: $displayTableHeader = TRUE; So I want to know if this is int, bool, etc.: $displayTableHeader = Creates table heading for display function tables (int: TRUE) OR $displayTableHeader = Creates table heading for display function tables (bool: TRUE)
View Replies !
Checkbox Name Attribute
I have a question. I have 3 checkboxes, but if I check checkbox1, and checkbox2 together, it saves only checkbox2 to the mysql database. Those checkboxes' name attribute are the same. Is there a way to prevent this? because one of my field names in the table is the same as the name attribute.
View Replies !
Soap Xml Attribute
why it's so really difficult to set xml attributes in a soap request using php? I'm troubled with this: I'm searching and trying but I'm able to generate a request like the following with Nusoap only: <auth><user id="id" password="password" /></auth>
View Replies !
Domxml_new_doc - Can I Add Encoding Attribute?
I've got a question about adding encoding attribute to my DOM XML Document? I'm from Poland and we use extended latin alphabet - I'd like to use iso-8859-2 Polish charset e.g.: <?xml version="1.0" encoding="iso-8859-2"?> is there such posibility in DOM XML?
View Replies !
LDAP And TelephoneNumber Attribute
Anyone have a problem with PHP returning the telephoneNumber attribute empty while all the other attributes return just fine. Someone had the same exact problem on phpbuilder but it was never solved. Apparently it holds true for facsimileTelephoneNumber also. Any ideas?
View Replies !
Populating An Auto_increament Attribute
I have just designed a BD. there are companies with auto increament which are integer. When I try to populate it after i tool value from another form and try to insert it into a table i recieve an error! I don't ask the companyID value from user as it is auto increament. Don't tell me to put NULL for that entry as it didn't work as well! Code:
View Replies !
SimpleXML Parsing By Attribute Value
I have an existing XML data set and would like to parse it with PHP5 based on the value of an attribute (any attribute!). I don't want to convert all my data from an attribute-heavy structure to a more proper element-based structure if I don't have to because of the javascript I am using on the client side. Listed below is the XML structure and PHP code I have been testing. My existing data structure looks like this: <gallery> <photos> <photo path = "sunflower01.jpg" width = "500" height = "375" thumbpath = "sunflower01.jpg" thumbwidth = "125" thumbheight = "94"> </photo> </photos> </gallery> The script is here: <?php $xml = simplexml_load_file("pictures.xml"); $image = $xml->xpath("/gallery/photos/photo[@path='sunflower01.jpg']"); echo $image[0]->photo@thumbpath; ?>
View Replies !
Reading Lastchild Attribute In XML?
I have this code: <root> <news> <item id="1" headline="I am a headline"> <item id="2" headline="I am also a headline"> <item id="3" headline="again, I'm a headline"> </news> </root> I want to use DOM to read the id-attribute of the last child. I want to do kind of this: $id = $dom->documentElement->getElementsByTagName('news')->lastChild->getAttribute("id"); It doesn't work... How do I do that?
View Replies !
Calendar - Attribute Eventday
i've been trying to modify a already done calendar, what im trying to do is getting dates where there are an event to get an backgroundcolor. The problem is that it does work... but if i set an event on 23' of feb i get a backgroundcolor there, which all 23' in every month get Code:
View Replies !
Counting Items In An Array Having X Attribute
I want to randomly select 5 cards from a standard playing card deck and count how many of each suit are returned: [connect] $sql = "SELECT * FROM cards ORDER BY RAND()LIMIT 5"; $result = mysql_query($sql); while($cards = mysql_fetch_array($result)) { $value = $cards["card_value"]; $suit = $cards["card_suit"]; $image = $cards["card_image"]; -------- Using count() within the loop returns a count of 1 since each card can only be of one suit. I tried using something like this: $spades = 0; if($suit='spades') { $spades = $spades+1; } and I tried a foreach statement to count within the loop which always returns a count of 1. Would someone be so kind as to point me in the right direction?
View Replies !
Sort A Group Of Nodes By Attribute? How?
I have the following XML file: <?xml version="1.0" encoding="iso-8859-1"?> <items> <item line="2">all that glitters is gold,</item> <item line="1">Theres a lady thats sure,</item> <item line="3">and she's buying a stairway to heaven</item> </items> To output this code Im using the following PHP: $xmldoc = domxml_open_file('stairway.xml', DOMXML_LOAD_DONT_KEEP_BLANKS); $node = $xmldoc->document_element(); if ($xmldoc->has_child_nodes()) { $node = $node->first_child(); $endwhile = false; while ($endwhile != true) { echo $node->get_content() . "<br />"; if ($node->next_sibling()) { $node = $node->next_sibling(); }else{ $endwhile = true; } } } This does what it supposed to do except I want to ensure that it outputs nodes ordered by 'line' attribute. The obvious answer would be to put them in order in the XML file and the above example is very simple so that you get the point, the real life example however will be much larger and encase anyone put something in the wrong order it would muck up my presentation. How could I adapt my code above to allow my nodes to be sorted? I dont mind the nodes being out of order in the physical file (stairway.xml) but when they are output using my script, I want them to be ordered.
View Replies !
Accept Form Attribute Not Working
I cannot get my accept attribute working properly inside either my form, or my input tag. W3schools says that accept is supposed to go inside the input tag, but msdn says it goes in the form tag. I need it for an upload form I'm making, I want to only allow application/octet-stream type files, so I put this as my opening form tag: <form enctype="multipart/form-data" accept="application/octet-stream" action="{$_SERVER['PHP_SELF']}" method="POST"> But I can still upload music, text files, and movies. What gives?
View Replies !
Altering LDAP Memberof Attribute
I have been using PHP's LDAP protocal to access Active Directory in my company. Authentication, search, and attribute editing have been working great for some time. Recently, I've been assigned to update our online AD manager to include membership altering - the "memberof" attribute. The user I use for working with LDAP is an admin, so it has full permissions. Adding a user with with ldap_add() an array like this work fine: .....
View Replies !
Tag Or Attribute For Correct Image Size
I have a php-generated webpage with images. My problem is: the Internet Explorer cannot calculate the correct image size. Because of this the images are not cached. So everytime a user clicks on some link all the images gets retransfered and the page loads very slow. You can check it if you right-click on an image and select properties. Is there a possibility to send the image and its actual size-information to the browser?
View Replies !
Target Attribute Picked Up On End Of Get Querystring
Can anyone see anything wrong with this PHP code: echo "<td width=ཛྷ'><a href='download.php?filename=".$FileDownload."&type=".$type." target = 'iframedownload' class='main'>Download</a> </td>"; When I click this the querystring appears to have the HTML target attribute in it, whioch it shouldn't because this is needed to load the page into the iframe.
View Replies !
Viewing Data Based On Attribute Value ?
The scores table has an attribute named "APPROVED" which data type is boolean (true/false) Can someone give me an idea on how to make grades data viewable ONLY IF the value on this column is set to TRUE Another question ? what is the datatype in MySQL equivalent to (true/false) in Access ( note : i'm using PHPMyAdmin ) and how true and false values are represented ?
View Replies !
Locating A Node's Text Value By Tag Name Or Attribute
I dont normally use DOM XML but have been given the task of integrating it with a web site using PHP. I have to use DOM XML as this is what is provided by the server. Basically what I am tryin to do is get it to load an XML document (that I can do) and find a specific node by its id attribute. The code I am up to is: Code:
View Replies !
After I Load An XML File, Can I Sort It By Node Attribute
After loading an xml file, is it possible to sort it by attribute? For example, I have the following xml file: <xml... <diary> <entry date="2005-01-01">I went to the park</entry> <entry date="2005-01-03">Sold the car today</entry> <entry date="2005-01-02">Went for a stroll</entry> </diary> When I go to load this using PHP, I would use some this similar to this: $xmldoc = domxml_open_file('diary.xml', DOMXML_LOAD_DONT_KEEP_BLANKS); $node = $xmldoc->document_element(); Before I go storming through the xml tree outputing along the way, can I sort it by (in this case) date?
View Replies !
Php-4.4.0 And Test.wsf = Error: The Value For The Attribute Is Not Valid: Language
We need to use version php-4.4.0-Win32 because one of the portal software doesn't support version php-5.0.5-Win32. We cannot get the PHP setup part working. Here is the error message: Windows Script Host Script: C:kits est.wsf Line: 3 Char: 11 Error: The value for the attribute is not valid: language Code: 80040049 Source: Windows Script Host Here is the code from the install.txt To test if ActiveScript is working, create a new file, named test.wsf (the extension is very important) and type: <job id="test"> <script language="PHPScript"> $WScript->Echo("Hello World!"); </script> </job> Save and double-click on the file. If you receive a little window saying "Hello World!" you're done. Everything works fine using php-5.0.5-Win32.
View Replies !
Simplexml And Attributes With A Namespace In Front. How Do You Getthe Attribute?
Here's a bit of xml code that works. <?php $string = "<?xml version="1.0" standalone="yes"?> <world> <people xmlns:ss="http://crap"> <person id="5">John Doe</person> <person id="2">Susie Q. Public</person> </people> </world>"; $xml = simplexml_load_string($string); print "<pre>"; print_r($xml); print "</pre>"; foreach($xml->people->person as $p) foreach($p->attributes() as $a =$b) { print "$a =$b<br />"; } // prints out // id =5 // id =2 ?> Now what if I change the first person to this <person ss:id="5">John Doe</person> Anyone know how to get the id? This is a question that is pertinent to an excel .xml file as you'll get lines like this <Cell ss:Index="3">stuff</Cell> btw: there is a guide on ibm that tells you how to do this with php and dom. I'm just wondering if there's a way to do it with simplexml.
View Replies !
Obtaining File Attribute - Title, PDF, Word, Excel
I'm trying to write something that will traverse the directory structure of my web server directory and pull some particular information on particular file types to create a listing of what all is where. For PDF files I want to find the title. I've been looking through php.net and the ClibPDF Functions, but I'm still not clear on how to find the title of an existing pdf document. Code:
View Replies !
How Can I Retrieve And Display Fields From MySQL To The Value Attribute Of Forms?
Let's suppose we have a table with many records like this : CREATE TABLE ARTICLE ( ID INTEGER NOT NULL , NAME TEXT NOT NULL , CONTENT TEXT NOT NULL , SOURCE TEXT , ARTDATE DATE , HITS INTEGER DEFAULT 0 , PRIMARY KEY (ID) )TYPE=InnoDB; I want to execute the following query: SELECT NAME,CONTENT,SOURCE,ARTDATE FROM ARTICLE WHERE ID=[some_valid_id ] CONTENT and SOURCE are usually fields with text of many lines. Code:
View Replies !
Height Attribute Of An Image To Be Controlled By Data In A Database Table
I want my web site to be as dynamic as possible (hence the reason for trying to master php) but the knowledge I have at the moment will not quite stretch to doing the following: I want to have the height attribute of an image to be controlled by data in a database table. The table will hold the numeric test result that pupils score when they take a test on my web based tutorial. The image is a column, the larger the score, the larger the column. I would like to know: Code:
View Replies !
|