Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Drop Down Based On First, Working, But How Do I Keep The Value If Page Reloaded?


I have a drop down list that is populated via MySQL. Once an item is selected a second drop down appears, again populated by MySQL. I know how to keep the value for the first drop down, if the page is reloaded.... but the second one is where I am having the issue.

Is it possible to have a page reload and echo not only the first dropdown value, but also the second within the <select> tags?




View Complete Forum Thread with Replies

Related Forum Messages:
Changed Page From .htm To And My Drop Down Menu Stoped Working
I have been building a rottweiler site for a friend. I just installed "The Search Engine Project" so I need to change one of my pages from .htm to .php so I can integrate the search results window into my layout.

But, whenever I change the page from .htm to .php my menu, a project 7 css drop down menu, stoppes working. Why is this? Code:

View Replies !
Setting Drop Down Based On 2d Array
I have an array as follows:

$arr_subtype[0][0] = "Jam";
$arr_subtype[0][1] = "Custard";
$arr_subtype[1][0] = "Not applicable";
$arr_subtype[2][0] = "Pie";
$arr_subtype[2][1] = "Cake";
$arr_subtype[2][2] = "Sweet";

If the value of the first element is 0, I want to display Jam/Custard in the drop down, if the first element is 1, just display 'Not applicable' and if first element is 2, display the Pie,Cake and Sweet values in the drop down.

I also have values for the 2 array indexes in variables, based on when user has selected a value. So when the form is redisplayed, it displays the existing value.
$index1 and $index2 are the variables for the selected values.  Where $index1 is a higher level list earlier in the code.

The first entry will also display a 'Select type' initially, when the form is first displayed (before they have selected anything). Code:

View Replies !
Drop Down List Based DB Query
I have a website in which I have like 20 Items. Every Item has its own distinguised Attributes. e.g

Item A
- Black
- Solid

Item B
- Socks
- Clothes

.. etc

In Database I have Two Tables. One for Items and One for Attributes. The ItemID from Items table is present in Attribute Table to link to attributes with a distinguished Item.

On the basis of above, I want to make two DropDows one for Items and One for Attributes, if someone select Item A from the Items Drop Down then Automcatically ONLY the Attributes related to Item A should Appear in the Attribute Dropdown.

View Replies !
Generic Data-based Drop Down Menu
This is becoming incredibly frustrating...

I have a pile of drop downs on one page. They are generated based upon tables in a database. After searching, the user needs to be able to refine their search. They click a form button and go back to the original search page with all the fields retaining the values of the original search. Everything works GREAT except my drop downs! They refuse to remember anything!

View Replies !
PHP Upload Files Drop Into A Directory Based On The Name Chosen
I am using the existing upload script and would like to add the ability to have the files drop into a directory based on the name chosen from the drop down list on the form. Currently all files drop into the same directory all the user is notified via email. I want to keep the email notification ability. Code:

View Replies !
Testing For Form Submissions (via A Submit Button) In Forms That Need To Be Reloaded
(I'll preface this by saying I did search around, at length, and couldn't really find any posts that exactly describe this situation. It's not particularly easy to search for, either, because the terms are so common.)

Here's a fun one. I have an HTML form, nothing fancy, with a drop-down ( <select> ) menu, a few fields, and a Submit button. When the user makes a selection from the menu, I need to reload the page to trigger some dynamic changes in the HTML that create the fields below, which are based on the user's menu selection. To reload the page, I have simply attached an onchange="document.form.submit()" behavior to the <select> element of the menu.

The problem I'm having is that the entire form contents are being submitted (obviously) when the user changes the menu. That's fine, but I need a clever way to determine whether the form was submitted because the user changed the menu, or because the user intentionally pressed the Submit button.

View Replies !
Working On Browser Based Game But...
I am trying to make a game but I am having trouble with the frickin armory2.php everything else pretty much work but I am having trouble with the part that tells how much the power of the weapons to units are...

I am using for loops to do it but I am not sure why the outer loop gets nulled by the inner loop... Code:

View Replies !
Chained Drop Down List Working Example
Could some PHP guru please help me? I looking for a good working
example of chained dropdown list.

View Replies !
$PHP_SELF - Create A Link Which Refreshes The Current Page, And Based On Certain Items On The Page
On a page, I want to create a link which refreshes the current page, and based on certain items on the page (simple form objects like radio buttons)the page will load differently. My link looks like this: PHP Code:

View Replies !
Date Drop Down Validation Not Working Correctly
Can any one see a reason why a date in Aug or Sept is erroring out on my validation routine (month is comming back as 0 for some reason). code ....

View Replies !
Can't Get Username/password Mysql-based Retrieval Working
I can't seem to figure out how to set up a MySQL-based password and username php app. Here's my code, it just goes blank when I run it and I can't figure out why. Code:

View Replies !
Page Based Upon Condition
I'm sure this question is really showing my "neophyte" status in php, but here goes: I've got a form that has a number of buttons. On submit, certain functions are called and, depending on which button was pressed, certain things are processed. So far, that part works fine. However, in two instances (add record and edit record) I want to display two different pages. This is where I'm having the problem. As you can see below in the code sample, if $buttonHit == Edit - I want to display edit_row.php; ELSE I want to display Add_row.php.

if ($buttonHit == 'Delete'){
deleteEntry($rowId);
} else if ($buttonHit == 'Edit') {
// LOAD EDIT_ROW.PHP;
} else {
// LOAD ADD_ROW.PHP;
}

Seemed straight forward enough to me at the outset, but I can't find the right .php function or syntax to get the job done.

View Replies !
PHP Drop Down To Redirect URL On The Same Page
I have a "Go" button and drop down list of the following:

Yahoo
MSN
Google

How do I link the Yahoo to www.yahoo.com, MSN to www.msn.com and Google to www.google.com upon pressing "Go"? The redirect will display the website on the same page.

View Replies !
Redirecting To Page Based Upon Usename
Is there any tutorial or code where i can find the the information on how to redirect to a page depending upon the user. For example

The first page has a form which contains username and password, after submit it is redirected to page base upon the username.

Such as if the user is john then it will direct to john.php or user joe will go to joe.php.

View Replies !
User Based Index Page
Both the users have same home page main.php.After logging with user1 only index1 page should be opened and with useer 2 only index2 page should be displayed. Code:

View Replies !
Change An Image Based On Landing Page - Possible?
I have 2 landing pages and I need to display a different contact phone number as an image for each page.

The thing that's got me thinking is that I need this image (which is in a standard header file) to stay the same for each visitor across all the pages on my site, depending on which landing page they came in from. I need the phone number image to stay the same for 30 minutes even if a user revisits one or more of the landing pages within that 30 minutes.

So is a visitor comes in from landingpage1 they see phonenumber1 throughout the site for 30mins - if a visitor comes in from landingpage2 they see phonenumber2 across the site for 30mins. What would be the best way to do this? php? javascript? would it need cookies?

View Replies !
Dynamic Page Title Based On URL Variables?
I am setting the title for a drupal site of mine with the following script:

<?php
drupal_set_title($_GET['Foo1'].' '.$_GET['Foo2'].' '.$_GET['Foo3']);
?>

that's working just fine... but I want to include some additional text in the title like this:

"search.php?Foo1=Bar1&Foo2=Bar2&Foo3=Bar3" ... title would be "Bar1 Bar2 Bar3 TEXT"

How can I insert additional text into this output? Can I put an echo in here somehow?

View Replies !
Build A Page Based On Some User Selections.
I'm trying to build a page based on some user selections. Things seem to be work properly but I can't get it to loop through more then the first record. Here's the Code:Code:

<?php
include 'config.php'
include 'opendb.php'
date_default_timezone_set("America/Edmonton");
require_once('PDF_Label.php');

$pdf = new PDF_Label(&#55617;&#57240;', 'mm', 1, 2);
$pdf->Open();
$pdf->AddPage();

$action=$_GET['action'];
switch ($action) {
case "Cal":
$searchStr = "xCalendar";
break;...................

View Replies !
Redirect To A Page Based On The Results Of An If Statement
I want to redirect to a page based on the results of an if statement. I have: PHP Code:

<?php
if (empty($vat_number)) {
echo "VAT number is empty"; /redirect to page1.php
} else {
echo "The VAT number is $vat_number"; /redirect to page2.php
}
?>

Does nauone know the best way to do this.

View Replies !
Drag And Drop File To Page View
I want to coding drag and drop but it has more problem. I wanna drag file from desktop and drop into page view then page view show description and file size, can I? Instead of browse from file by use button. How should I do about this?

View Replies !
Drop-down Filtered From User Input On Same Page
At the bottom of an order form on my site I have a dropdown box from which the user must select from a list of pre-defined shipping schedules. I currently have the dropdown filtered by only displaying shippings where the date is >= now().

However, just above this box they input a pick-up date in a text field, or by selecting a date from a pop-up calendar that then fills in the text fields. How would I be able to have the dropdown filtered by a date >= the user input?

I'm assuming it would be an action that would filter the dropdown each time the user clicks outside of date text field, but I'm not really sure where to start and haven't come across anything helpful, in this regard, during my forum searching.

View Replies !
Multiple Page Generation Based On Post-length
Ok, first I'd like to apologize if this has been covered before, but I couldn't find it via the search options and it's been a long time since I've been here.

I'll give you a summary of what I'm trying to do, and you all can point me in the best direction on how to go about it!

I'm trying to design an online article posting section, where the members can post articles about things. The problem that arises imediately, is post length. What if someone posts a "3 page" article by word-processing-program standards, and then outputted this to the website? It would be a really long page and if the page was setup with a specific UI size design in mind, it would blow this apart.

I'm sure you can understand what I mean.

So, I need to be able to get the post's length, figure out how many pages I'll need to break that length up, then break it apart for output to the screen in segments with links for next page continuing the article.

Now, the post's length isn't hard, (strlen) and figuring out how many pages isn't that hard, dividing the post's length by the desired amount of characters wanted in the UI.

The part I'm stumped on is breaking apart the post into many peices that break at 'spaces' not in the middle of words, and that continue where the last one left off, not leaving any words out.

If this has already been covered, or someone knows of another site that has it, please post it!
If someone knows of a really simple way to do this, by all means, dazzle me!

View Replies !
Creating Dynamic Page Based On Dropdown Selection?
I'm using Dreamweaver, but I believe this is a general PHP/MySQL question. I have a table, with 4 fields: id, year, car_make, car_model. The data looks like this:

1 1992 Honda Civic
2 1994 Ford Probe GT
3 1999 Audi S4
4 2002 Porsche 959

On my web page, I have a drop down list that's propogated automatically with the "car_model" field entries which are pulled from that table. So when I click the down arrow, I see Civic, Probe GT, S4 and 959. Code:

View Replies !
REdirect Users Based On Their Access Level To The Appropriate Page.
I'm trying to direct users based on their access level to the appropriate page.

If admin_access = 1; these users should go to welcome.php.
If admin_access = 2; these users should go to index.html.

When I test the accounts with the levels, the users all go to welcome.php. Can someone help me out in redirecting the users to the proper location? Code:

View Replies !
PHP Page That Displays Html Based On The Address Enterd
I would like to have a PHP page that displays html based on the address enterd. For example:

index.php?example=a would show a page with <body>Example1234</body> whereas index.php?example=b would show a page with <body>Example5678</body>.

I've done this before, but I can't remember the code I used.

View Replies !
Saving Selection In Drop-down Lists In PHP After Page Reload?
I can't find an answer to my quesiton anywhere.

Given a drop-down list with USA states and other text fields I pass
this information for further processing via PHP. If any of the required

fields is empty, the PHP script would return an error and reload the
form page asking to fill out those fields. All entered information is
saved... except for the drop-down list selection. I tried to write a
Javascript function which is echoed by PHP, but interpolation of PHP
variables in the Javascript section gives a syntax error message in
Javascript.

The PHP script returns, e.g., an "AL" string for Alabama. Of course, I
don't want to write PHP code for each option to make it selected.

View Replies !
Setup A Page When You Open A Drop Down Menu Of Options
How do I setup a page when you open a drop down menu of options, select an option and then an image on the page changes to the selection you landed on. Code:

View Replies !
Drop Down Menu - Every A Value Of It Is Selected To Reload The Page And Submit That Value.
i have a drop down menu and i want every a value of it is selected to reload the page and submit that value. i'm using something like this: HTML Code:

<select name="menu">
<option selected value="1">GENERAL</option>
<?php
while ($cat = mysql_fetch_array($q)) {
$cid = $cat[0];
$cname = $cat[1];
echo "<option value='$cid'>$cname</option>
";
}

echo "</select>";

i tried using <select name="c" size="1" onChange="MM_jumpMenu('parent',this,0)"> but i got confused so i'm looking for an alternative way..

View Replies !
Browser Based Ftp Login - HTML Page Where Users Type In A Username And Password
First let me say that I don't really know PHP at all. What I want to do is have an HTML page where users type in a username and password. After they click submit they are redirected to
"ftp://username:password@domain.com" where they can download and upload files to their folder.
Each username will have a folder in the directory that has the same name as the username. `So if "Mark" logs in, I want him to see the contents of the "Mark" folder where he can upload and download files. I don't want him to have access to anything else.

As I know nothing, I did a lot of reading up and researching on how to do this (lots of great information on this site by the way) but the PHP code might still be way off.

Here is the code I have so far:
for the html login page:
<html>
<body>
<form name="form" method="post" action="ftp.php">
Username: <input name="username" type="text" size="30">
Password: <input name="password" type="password" size="30">
<input type="Submit" size="8" value="Submit"></p>
</form>
</body>
</html>

the code for the ftp.php page is :
<?php

$ftp_server = 'domain.com' //domain being the future website domain
$ftp_username =$_POST['username'];
$ftp_password =$_POST['password'];
$location = 'ftp://$ftp_username:$ftp_password@$ftp_server'
header('Location: $location');

$ftp_connect_id = ftp_connect($ftp_server);
$ftp_login = ftp_login($ftp_connect_id, $ftp_username, $ftp_password);
if (! $ftp_connect_id || ! $ftp_login)
{
echo "Unable to connect to ".$ftp_server;
exit;
} else {
echo "Connected to host "<p>";
}
ftp_close($ftp_connect_id);
?>

right now, when i check it, I log on the html page and go the the php page where all it says is "Connected to host."

I don't see the "ftp://username:password@domain.com" that I want to see.

View Replies !
Two PHP Scripts On One Page Not Working?
I have two small PHP scripts running on a test page

Both scripts work perfectly when there is one script on a page. However, if I place two on the page (one above the other), the second script will not render. I get no PHP error messages - the script will just not render.

I think the PHP Scripts are OK as they were automatically generated by RSS Feed Burner and both do run separately.

There may be an issue with having separate calls of some kind on the page or my server might not be set right. I did a server test that I think shows that it is OK but I am not sure. The only think I have in my htaccess file for PHP is: "AddType application/x-httpd-php .htm .html" .

I am new to PHP and was wondering if anyone can see why both scripts will not run together?

View Replies !
Calendar Page Not Working (in IE)
I have been hard at work on this one and my computer broke so I haven't been able to resolve this problem for a bit, I open the webpage in IE and it doesn't show up but in FF it shows up just fine, anyone able to give me a hand on this one, it was working fine awhile back but now for some reason it seems to have broken. Code:

View Replies !
Flash Not Working On Page
I have inserted Flash animation on my page as normal (using Dreamweaver)- only it won't display in the browser for this site - which has various php/mysql pages on it - but this one is a simple html page - which displays the html - but not the Flash ?

The flash displays in the browser if I insert it into a page on another site - which does not use php/mysql.

Is it to do with the set up of the site which uses php/mysql ? - e.g. the fact there's testing server settings. My sites/servers are hosted remotely - and not on my own machines.

View Replies !
Session Not Working On Page 3
session ..cant get it to work on page 3 it will not display anyhting on page 3
whhat i do wrong Code:

View Replies !
Login Page Not Working
I have a database installed that can accept a csv file.
when I installed onto a new server, it wont upload.  is there anything obvious in the phpinfo that could be causing this? also, the login page wont work on this server.
just reloads the page again when submitting the user and pass Code:

View Replies !
PHP Dynamic Drop Down Menus, Page Displays Diff Data Depending On Dropdown Selected.
I currently have two drop down menus the first one with countries and then the second one changes depending on which country is selected to display counties.

This works fine, now what I want to do is have it so when it county is selected it shows all the squash clubs that are in that county below the drop downs. Code:

View Replies !
Get Two Dropdown Lists Working On A Page
i am trying to get two dropdown lists working on a page. How do i go about this. For example, I have 1 table which holds countries and cities. When a user selects a country in the first dropdown list, i'd like the second dropdownlist populate with a list of cities etc. from my database.

View Replies !
Working With Dates On The Modify Page
I have a column in a table called testimonialDate. It is of type 'date'. When trying to modify a record, I can get it to display nicely on the modify page using:

$testDate = $testrow['testimonialDate'];
$testDate2 = strtotime($testDate);
$newdate=date("m-d-Y", $testDate2);

then <?=$newdate?>

However, when I change the displayed date and hit the modify button, it blanks out the testimonialDate column in the record selected.

I've found a lot of hints on the internet for displaying, but how do I send the info back up?
I'm also having issues trying to add a record. Typing in 3-3-2003 in text field results in 2003-3-20 in database.

Can I get some hints or a link to a good tutorial?

View Replies !
$HTTP_REFERER Not Working On Index Page
I'm using $HTTP_REFERER in various parts of my site and it works well. When I use $HTTP_REFERER on my index page to see where members are coming from before they log into my site it won't work. Perhaps this has something to do with the previous page being from an outside site?

View Replies !
I Can't Get Info.php Working On PWS Win98 The Page Cannot Be Displayed
Can someone help me?
I have tried php-4.3.4-installer
I have tried php-4.3.4-Win32
If someone has PWS running PHP4 on windows 98
I would appreciate any help. thank-you

View Replies !
Submit Page A D Working With $_post Data
I am working with data that I pull from one of tables in my data base and format it into tables for ever entry on my webpage. In each table I place a check box called review (see code below): Code:

View Replies !
Php Code Embedded Inside Html Page Not Working.
How do I make or workaround in my Apache server to parse *.html files
for
<?php ?> code embedded in it?

Currently php recognises <?php ?> tag only if the file has a *.php
extension. Any php code inside *.html or *.htm is ignored.

Since I dont have admin access to the server or admin person, changing
the php configuration is out of choice. Now I have to go thru echo
and print statemnets to get it work. But it looks very cumbersome and
prone to errors.

View Replies !
Links Stopped Working - Use PATH/index.php?p=PAGE In My URL
i have just moved my website from one server to another, on the first my pages worked perfect (not considering markup) but now my links just won't work anymore...

i use PATH/index.php?p=PAGE in my URL, it worked well on the other server, but after i switched it just stopped working...

and i have no clue where to find the error... it just keeps showing the first page...

View Replies !
Log Out - Page Expired Not Working Or Pressing Browser Back Button
I am a problem with I logout from my site. When I push log out link I send it to a new page with this script in this:

<?php
session_start();
session_unregister($SESSION);
session_destroy();
unset($SESSION);?>

In each page I have this other script
#accesscontrol.php
<?
session_start();
if (session_is_registered("SESSION")!= FALSE ) # ya la sesion existe entonces la cargo
{ #Maybe I use after. } else
{echo "<h1>Sorry...</h1>";
echo "<A href = "index.php"><H4> Login Univernet</H4> </A>";
session_destroy();
exit;}?>

The problem is when I log out and press the back button I am back to the pages. Sometimes it tells me that page expired but if I reload the page everything is ok and all my "security" pages are available.

View Replies !
How Do I Change The Drop Down List So The Option Selected Last Time Is Then The Current One Shown In The Drop Down Box?
I have a drop down list with the town options 'Bury' and 'Ipswich' as
shown below.

When selecting one of the options, its value is passed to variable
$townsearch.

How do I change the drop down list so the option selected last time is
then the current one shown in the drop down box?

<body>

<?php $townsearch = $_get['town']; ?>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">

<select size="1" name="town">

<option>ipswich</option>
<option>bury</option>
&nbsp;
</select>&nbsp;

<input type="submit" value="GO" />

</form>

View Replies !
Form Processor To Redirect To A Specific Page Based On The Selection Of A Radio Button On The Form.
I need to have a form processor to redirect to a specific page based on the selection of a radio button on the form.

It would be like this:

If selection is button "A" then goto A URL
If selection is button "B" then goto B URL
If selection is button "C" then goto C URL

I don't know how to code in php or when I would put such a statement.

View Replies !
Drop Down Lists Changing Depending On Other Drop Downs
I want to have a drop down system like this one.  But without the radio buttons.

I want to have 3 drop downs but have no idea how to go about it.  I assume I will need to activate some sort of Javascript on the onChange event of the option drop downs.

View Replies !
Cookie Based Script To Session Based
PMsys is a script that based on Cookies rather sessions(what are people thinking in 2003?)
To intergrate this system to mine website, I got to change all the cookies to sessions.
So, I think 1st replace all the:

$_COOKIE into $_SESSION
and then write a function that search and find a line that contains:
setcookie('a', 'b', $whateverthetime);
into
session_start()
$_SESSION['a'] = 'b'

will that work? is there anymore things I have to think about? anyone can write a function to do that? I just can't get a hold on regular expressions.

View Replies !
Drop Down 2 Echo Seletion On Drop Down 1
I would like to put up a list/menu drop down so when you select something it echo's something in the second drop down.

Example

Drop menu 1
-----------------------
course 1
course 2

Drop menu 2
-------------------
If course 1 echo course 1 dates.
If course 2 echo course 2 dates

Does anyone have an example for me or what do I need to search for cause I don't quit know what it is called and thus I cannot find anything on Google.

View Replies !
EyeOS : Opensource Web Based Operating System Based On "php"
EyeOS is a Opensource web based operating system based on "php".

try demo here

http://eyeos.info/eyeOS/

View Replies !
Working Connection... Not Working? (Advanced)
It has tons of modules, and obviously a config file which opens the db connection. But there is one, and only one, module having strange troubles.

$query is just a simple INSERT INTO command. But it does not inserts anything. I only obtain... nothing. Neither an error from the server! Code:

View Replies !
Sessions Working, Then Not Working?
I wrote a login script (one that I have used on quite a few sites previously) and have found that it was working, then not working, then working again now not working - all without me changing any code. Here is the process:

1) l/p gets sent to login.php to query the db

2) if login successful, set $sid = session_id, and other session variables, register them in the session, and redirect to main.php

3) first thing on main.php is check_login function, all this does is see if $sid is set and equal to the current session_id(). If succeed continue to display data on main.php based on registered user data. If fail, redirect to error.php with the appropriate error code. this all takes place on a shared ssl server if that matters.

The trouble I'm having is the check_login function is failing because no session variables are present, including $sid. I'm 99.9 percent certain it's not a code issue because 1) I have done this same script many times before with no trouble, and 2) this particular one was working before So I am really looking for php configuration issues to check on, or things like that.

View Replies !
Web-based PHP IDE
due to being a traveller with a constant problem of getting connected
to my server and update
or recode chunks of my site.
Web based IDE for php with login stuff so only i can edit my site...
I can of course create one of my own (read above - me = php developer)
but it takes time and effort... so i want to see first, if there's
something already made out there...

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved