Hey all,
I am still fairly new to PHP programming and I am trying to put together a page where you select search terms from a drop down menu and it keeps the menu at your search choice in the menu after the search.
Here is the code I was suggested to use, but I am having problems understanding how it keeps the choice in the menu.
I can almost understand how it works, but I need a little push to grasp it.
Here is the code:
foreach($options as $key => $content)
{
if ($key == $value) $select = ' selected="selected"';
else $select = NULL;
$html .=
'<option value="' . htmlspecialchars($key) . '"' . $select .
'>' . htmlspecialchars($content) . '</option>' . "n";
}
Now I understand how to walk through the code, but I am having trouble understanding how it holds over the choice.
THanks in advance for the help...
Not sure why this script is not working?
Hi I am new to php programing and I was trying to make up a simple script like a captcha but I cannot get the validation part of it working. I think it should work but it is not. Anyone know what is
Remote Database Access
Hey guys!!OK, i'm used to only working with databases from the CPANEL, accessing phpMyAdmin after setting up a mysql database in the cpanel.I've been asked to setup a website and the client has set up
php redirecting
i wont open a new thread but i have a question about redirecting....i wonder why my code doesnt redirect me..........foreach ($_POST as $key => $value){if ($req == '1'){if ($value ==
Empty text file when there is over XXXX lines of text.
define("RANDOM_FILE","/public_html/random.txt"); $randomEntry = "This goes in text file.\n"; { $randomFile = fopen(RANDOM_FILE,"a"); }
Dynamically allocating the number of rows in a table based on a variable value
Hi, I have situation here which i cannot resolve, I have a variable temp which stores the number of rows in a array for example temp=5 which is calculated based on other values in my table( so temp
writing a screen scraper
Hello,I'm writing a screen scraper application and want to be able to get absolute addresses for images from relative links.So a link like this: Code: <img
1,000 select boxes with 100 options?!
I have 1 drop down select box with 1,000 options.In some case, there will be 100+ of these select boxes, with absolutely identical options.Is there any way to avoid repeating 1,000 options for 100
problem with query error
First Thanks to those who helped me on my previous posts, and the following code i'm using is not mine, i grabbed it from here http://www.phpfreaks.com/tutorial/basic-paginationNow onto the
ScriptManager History and Opera Issue
I am having an issue in opera with the ScriptManager. I have a ScriptManager on a page with history enabled. On the same page i have 5 LinkButtons which update Panel content. On the OnClick event of
moving mouse to display image coordinates
I have an existing MFC application that shows an image in the main window.I'd like to be able to move the mouse within that image & display the correct image coordinates to the user.How difficult