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 Complete Forum Thread with Replies
Sponsored Links:
Related Messages:
Identifying Individual Users
I know that you can identify users using an ip address. But what if you have several users with different computers in one room sharing the same ip address. Is there anyway to differentiate each individual. Is there a unique signature from the computers that can be used?
View Replies !
View Related
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 !
View Related
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 !
View Related
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 !
View Related
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 Replies !
View Related
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 !
View Related
Selection From A List Box.
php and have to implement this functionality to select a user from a list box. I have written the code for this, but the problem is after selecting a name and doing the required task, it again selects the first entry in the list box. So if there are 100 users, the 100th one has to scroll down again and again. I need to modify this code so that until the session expires, if a person has selected his name once, that name will be selected in the listbox until he changes it. <select name="name" style="width: 120px;"> <?php $query = sprintf("select * from person order by person_name"); $result = mysql_query($query); $i = 0; while($row = mysql_fetch_array($result)) { $i++; printf("<option value="$row[person_num]">$row[person_name]</option>"); } ?> </select>
View Replies !
View Related
Selection Of Records In List
I was wondering how to query MySQL to display only a selection (1-20, 21-40) of a query in an HTML list. Can that be done in an SQL statement, or do you have to use PHP to dissect the returned array with for n elements to n+20 elements. How does Google achieve the returning of results in its search engine. I imagine that the same query may not necessarily be executed each page listing. I am wondering whether the results from the query would return an array of say 36000 elements.
View Replies !
View Related
Multiple List Selection
I am still learning PHP, which is the best language for database driven sites. I am using Dreamweaver CS3 with the devleopers toolbox which is "ok" to help take the guess work out of things. I am using a simple registration form that i made with the toolbox, but when I come to a multiple list to choose from (populated from the database) it doesn't work correctly. Of course, out of the multiple items selected only the last one gets inserted. From what I have read, the selection must be turned into an array then looped for this to work. Is this correct? Next how would I code this to work right.
View Replies !
View Related
Getting The Selection Box To List The Results Alphabetically?
Below is a snippet of my code. How do I go about getting the selection box to list the results alphabetically? I'm a newbie, so the more specific - the better. <select name="city"> <? $sql="select * from city"; $rez=mysql_query($sql,$dblnk); while($row=mysql_fetch_array($rez)) { ?> <option value="<? echo $row['id'];?>"><? echo $row['city'];?></option> <? } ?> </select>
View Replies !
View Related
Calling A Php Function From A Form Selection List
I have a function that will read records from the database and populate an area of my webpage based on a value selected from a list box. I have got it to work fine if the user hits a submit button but I was wondering if it possible to perform the function dynamically each time the user changes the value in the list box.
View Replies !
View Related
List Box Selection To Display Record In Form
I have developed a database in mysql and php for contact management. I have programed in several older languages but am new to both mysql and php. I need to display information in a form but want to select the record from a drop down list either by typing or selecting from scroll. Problem 1 first and last name in seperate fields so search in list box a problem because I can only select one field. Second... after selection of name in dropdown list how to tell the form to refresh to the record selected. Third I would like to display contact information in a form on the top of the page (from the selection from listbox) and at bottom a list of touchpoints that pertain to that contact from the touchpoints table.
View Replies !
View Related
Online Users List
I am developing a web-based game with a full user/account based system. One of the features I plan to add is a buddy list, where users can select other users as 'friends' or whatnot and then have them on a quickly accessibly buddy list for messaging, viewing game status, and inviting to games etc. Code:
View Replies !
View Related
List Of Users With Session Variables
I'm trying to generate a list of users that are logged in. I thought about using a lastlogin field and calculating time, but what if they stay logged in for more than that time? I thought about using a clicked field, but changing the time on that every time someone did something could get really expensive especially if there are a lot of users. I think that using session variables would be best because I can just destroy the session when they logout and it will get rid of itself if they don't do anything for a while. Can anyone give some advice as to where to go from here? Is there a way to return an array of usernames if I create a $_SESSION["user"] variable and set it when someone logs in? Or should I make some kind of associative db table with session ids and user ids? What would be the easiest way to do this and what would be a few skeleton steps to get started?
View Replies !
View Related
List Of All The Users Currently Viewing The Forums
i've made a forum and now i'm just looking to add the finishing touches. What i want is a list to be created of all the users currently viewing the forums. Now, i presume i would need another column in my 'users' table say, for example, called 'online'. When they're online set it to 1, if they're not, set it to 0. Now, the trouble comes when the user quits the forum. I cant figure out a way to set the 'online' value back to 0.
View Replies !
View Related
Display List Of Logged In Users
I'm making a small website that includes a user login/logout feature. Its a friendly site and isn't anything fancy. What I'm working on now is to display a list of all the users that are currently logged in the website. The system I'm using now is basically a table ("current_users") that contains all the usernames of users that have successfully logged in. The table would fill as users logged in and empty as users log out. The problem is what if the user never clicks "logout" (and thus never executing the script that removes that user from the table), but simply closes the browser? The table would then never have a chance to remove that user from an "logged in" status.
View Replies !
View Related
Maintaing List Of "online" Users
I've seen a few posts asking for a way to keep a list of all "online" users. For example, when the user logs in, his/her record in the database is updated to show that the user is currently logged in. There can also be a "logout" script, which sets the user's status in the database to "logged off" when it is run. The problem is, however, that many users simply close the browser window, in which case the logout scripts does not run at all. So far, there only good solutions for this problem involved checking user's activity in certain time increments (like 5 or 10 minutes) and if there is none, assume that the user has logged out. However, this would not work for me, because I have to allow for arbitrary long periods of inactivity (while still browsing my website) before logging users out automatically (not just 5-10 minutes); but log users out immediately when they leave the website. While reading the user notes in PHP manual, I've come accross a possible way of solving this problem (this script can be included in an invisible frame on any website): PHP Code:
View Replies !
View Related
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 !
View Related
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 !
View Related
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 !
View Related
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 !
View Related
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 !
View Related
Identifying Browser
Is there a way to identify the brwser a visitor to my site is using? I would like to include site style based on the visitor's browser. If their us IE show layout one way, if their using Firefox show it another way...etc...etc.
View Replies !
View Related
Identifying People
on my website i'm finding people are coming back and signing up again and again... how can i log them so i know who has logged in before. was thinking IP but does this not change per session online with dial up?
View Replies !
View Related
Identifying A Value Range
i have a form that submits to a php file, the form basically has a hidden field called number: <input type="hidden" name="number" value="12"> i know how to read the value of that, its simply putting <?php echo $_POST['number']?> but what i want to do is check if the number is between 1 and 25 and if it is then echo A else if it is between 25-75 then echo B else if it is anything above 75 then echo C .
View Replies !
View Related
Identifying SSL Clients
I have a site that uses PHP sessions through SSL, my employer does not wish the site to require cookies so I have switched on the use_trans_sid option for users who have cookies disabled. The problem I have is stopping session hijacking. If I am on a page "https://secure.mysite.com/page.php?PHPSESSID=XXXXX" And I email the url to someone else they can get onto the site without being challenged for a logon. I am trying to find a way to check that the connection is still coming from the same SSL connection, e.g. by checking the clients public key, but I can't find a way to get any information about the SSL connection from PHP.
View Replies !
View Related
Identifying An Image
Ive got a tracking system which tracks how many times a user clicks on an advert on my site. At the moment all the listings are set as one so when a user clicks on that advert it gets one click. However, one of the adverts is now going to contain two images advertising two separate companies. Ive set it up so the images and urls are different and they go to their own websites and in my tracking table i have just added an extra column called image and the number 1 goes in if image 1 is clicked on or 2 if image 2 is clicked on. However, to display this is the bit im not sure about. At the moment its displayed in a table like this: Advert Name Category Number of clicks Advert 1 Shopping 257 However, if advert 1 has two images, meaning two separate companies, how can I show this in the above table?
View Replies !
View Related
Identifying The Clicked Record
i already know how to load the my list of suppliers using mysql/php/apache, but what i would like to do now is put a link for each and every supplier and when someone clicks it, they will automatically go to that supplier's list of products. i want something like this: SUPPLIERS TABLE supplierID, Name, Address, AA Alfin21 1506 w. 66th street <>EDIT<>
View Replies !
View Related
Identifying Search Engines
my website is pretty much database driven and i've typically parsed the data in PHP and just output flat HTML. however, i'm trying to save some badwidth by spitting out just the critical information, and have javascript parse out the data. however, i'm kinda worried how search engines would react to this. (especially google) would search engines ignore the keywords if they are inside javascript tags? how do i detect search engines? maybe i can just setup a special script that output's "search-engine-friendly" output.
View Replies !
View Related
Identifying Black Images
I would like to be able to identify completely black images in order that I can exclude them. I am thinking I could use gdlib but I cannot find a suitable function. If I can find the rgb of the image then I can exclude it.
View Replies !
View Related
Identifying A Page Via Hyperlink
I have a page (product_wide.php) that displays sale items. In that page, I "include" a 2nd page that contains hyperlinks to general item categories. The hyperlinks in filternavbar point to product_wide, and display items from the category selected. I need a way, using the same hyperlinks I am using now in filternavbar, to tell, from product_wide, that it was from filternavbar that the link was clicked (as opposed to some other page in the site that takes you to product_wide. I can't change the configuration of the filternavbar url because of duplicate content issues with google.
View Replies !
View Related
Identifying Dynamic Form Fields
User goes to page which is a form that asks for some basic info regarding returning products for credit/exchange, and also asks for how many products are going to be returned. Upon submitting, a return authorization form is presented to them with the specified number of product fields. I now want to take the input from this form and email it to myself, as well as, display a confirmation page to the user. The problem I have is a can't say, for instance, echo "$field_name"; because field_name will get created dynamically after the user specifies how many products to return. For example, say the user says 5 products, this will generate a form with field names like: return_code0 inv_num0 qty0 product0 cre_exch0 stockout0 return_code1 inv_num1 qty1 product1 cre_exch1 stockout1 return_code2 inv_num2 qty2 product2 cre_exch2 stockout2 and so on.... These get created with a for() loop. Once this form is submitted, how can I address the field names? Code:
View Replies !
View Related
Identifying Non-Supported Characters In A TTF File With GD?
I've managed to get GD working (mostly anyway) on my site - and am utilising the "imagettftext" function. I am using this function to display individual characters on my website - with a nominated Font. However, sometimes the characters in my StringText are not supported by the particular font that I am using ... Directly from http://www.php.net/manual/en/function.imagettftext.php imagettftext - "If a character is used in the string which is not supported by the font, a hollow rectangle will replace the character." Can anyone suggest some code that would: 1) compare/look at the StringText supplied within the "imagettftext" function (in my case the StringText will comprise of a single character only) 2) where the supplied StringText (ie character) is NOT supported by the font, then I need for that character to be reported as not supported. ie. either; return a flag or skip the non-supported character entirely - rather than displaying the standard "hollow rectangle".
View Replies !
View Related
Identifying Opening Link For Database Query?
I've got a tricky problem i need to solve, i'm building a banner exchange type site in which there are already about 100 banners so i've had to code things around what already exists to a certain extent. Now each of the banners that go out on other sites have a link on the banner which pops open a window with details of the banner. this would be fine if all my banners were gifs and jpgs but there are also swf and dcr banners so i have no real control over the actual link on the banner. up until now each banner had a html page made for it so when you clicked on a banner it would open a page banner_1.html which had the details of that banner. for obvious reasons i'm going to replace all these redundant pages and put a htaccess redirect at their url to all redirect to a common page popup.php so all details will be dealt with in one file. ok this is fine but my problem is in this page popup.php i need to identify the link that just opened the window so that i can then get the info from the database to put on the page.. remember i can't use the url like so... bannerpage.php?thisbanner=1 but all existing links have unique addresses, is there a way to do this, i'm pretty sure there must be but i can't get my head around it?
View Replies !
View Related
Form, Type=file And Identifying By Isset()
Windows XP PHP 4.4.2 Apache 2.2 Register_Globals = Off Safe_Mode = On ----------------------- Hi All, I am having a problem getting a file browse input field to be recognized on the next page. Let me show you... page1.php Contains a web form with a file input to attach a file using a browse button. <form method='POST' action='page2.php' enctype='multipart/form-data'> <input name='uploadFile1' type='file' id=uploadFile1'> page2.php contains a validator to check the input and perform an action based on whether or not the browse input field has been populated. // IF THE POST CONTAINS A FILE UPLOAD, PROCESS SECTION 1 IF NOT PROCESS SECTION 2. if (isset($_POST['uploadFile1'])) { echo "File is attached so print this."; } if (!isset($_POST['uploadFile1'])) { echo "File is NOT attached so print this."; } If the user uses the browse button on the form page to populate the field with a file path to a file on his pc, then I expect to see the "File is attached message". However, regardless of whether someone does or does not browse a file, the message is always that they have NOT browsed a file and the variable "uploadFile1" is effectively left unpopulated. OUTPUT File is NOT attached so print this. Conversley, I thought I might be able to use the _FILES variable instead of _POST, but I get the exact opposite, that the browse field is populated all the time whether or not someone has browsed a file or left the browse field blank. if (isset($_FILES['uploadFile1'])) { echo "File is attached so print this."; } if (!isset($_FILES['uploadFile1'])) { OUTPUT File is attached so print this. So, I am missing something. Can someone give me some direction so that I can simply identify (with register_globals = Off) whether or not an input field (input type=file) has been populated or left blank? Is this even possible? What am I missing?
View Replies !
View Related
Voting System - Identifying Voter And Integrity Of The Vote
I am trying to setup a voting system for our intranet (staff awards - free text fields). I have the database adding the votes no problem. What I would like to do however is the following: 1. It's our intranet, there is no need for each person to login so it just uses "user/user". However I need to capture the person's login on the vote record so I can identify who voted. 2. restrict the users to one vote each. I have done some research and it looks like I have to create a cookie.
View Replies !
View Related
|