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




Detecting Checkboxes And Option Lists


I am trying to figure out how to detect a <Form> check box being checked in a PHP script.  Likewise, I am trying to figure out how to detect which option was chosen in a <option> list of drop-down items in a form. Code:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Select <option> </option>
I have this script in a form, it is trying to send a selection from the from to the next page. But the proble is that if the selection has a space in it, it only sends the first work to the next page. Code:

Mailing Lists
I have searched in many places about how to set up a mailing list that is scalable yet no web sites seems to want to give out this info. I need to have this mailing list be effective even up to hundreds of thousands of users. Any advice/resources on how to set up this mailing list?

Email Lists
How would I go about making email lists? Someone who has something similar to what I want told me that they handle it with PHP. I'm not talking about a form where I can email an entire list, but rather an email GROUP, such that any time email went to URL from ANYONE that is a member of my site, it would come into domainname.com, and then sent back out to everyone in the "group".

Any info would be helpful. Is this possible with php? What is the email process? Right now I'm not even on a domain name on my own server.

Drop Down Lists
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>

Ordering Lists
I have developed a script (with help) that tries to order events stored in my .txt file by date. The .txt file looks like this: 1st|Jan|Meeting at House| 15th|Feb|Meeting at your House etc

The script orders the dates from lowest to highest but does not order dates before the 10th. Apparently 1st - 9th comes after 31st.. Code:

Maintaining Mailing Lists
I've few doubts; I'm asking two problem here.

1st, can we use PHP for maintaining mailing-lists. Say, we've 1000 users, need be e-mailed a subscription newsletter i.e. $message is same, loop through e-mail array in db.

2nd, Web site search. We maintain database after reading files using PHP and manipulate results from db.

Question is, if PHP is a solution for these problems, also, when users' ( 1 ), keywords' ( 2 ) dbs grow big! There is also a limit of a PHP script execution. In 1st case, PHP has to parse, suppose 10k subscribers, and generate 10k e-mail for sendmail program.

Is PHP feasible for such things. What else, is a better and professionally used solution. I don't know CGI? Perl?

Multiple Selection Lists?
i have a mutliple selection list on a form that goes like this

<select name='name' multiple size=6>";
echo "<option value='one'>one";
echo "<option value='two'>two";
echo "<option value='three'>three"; etc it works fine.

BUT how do u call it. For example say i selected option one and three. How do i call that on the next page so that ONE and THREE are stored.

Less-expensive Way To Set Up Defaults In Lists Etc?
I'm currently setting up default selections in <select> lists by
passing an array of those defaults as keys ( 'valuefoo' => true ) as
an argument to the function that sets up the list. Then, as I build
each <option>, I call array_key_exists ( thisoptionvalue,
arrayofdefaults ) to check whether to include the
'selected="selected"' string.

So the code looks something like

Routine ( array( 'valuefoo' => true, 'valuebar' => true ) ) ;
.....

function Routine ( $defaultvals )
{
for ( $i= etc. )
echo '<option....' . ( array_key_exists( 'curroptval',
$defaultvals ) ? 'selected="selected"' : '' ) . etc ' ;
}

(I've elided a lot of syntax, but you get the idea)

That seems slow and tedious. Does anyone know a cheaper way?

Quote's Invoices Lists...
I need someone to bounce some ideas off.

This is what I'm trying to do, I want to be able to create a script that
will spit out a quote based on the information filled in.

The part I'm stuck on is. Entering all the items in.

Ok, say I have a form, it starts off where you put in all the details
(eg, who the quote is for address phone no etc.)

Then there will be a list of items to go onto the quote.

Now this is the part I'm stuck on. I'm thinking maybe something like an
add new item button that opens a new window and then you enter in the
details for each item.
This then adds each item to the quote. Each item that is entered can be
added directly to the database. So what I'm thinking maybe is a popup
window that you fill in the details for each item, you hit submit, and
then it goes back to the origional quote page, but now with the item
added to the list.

Maybe is there java script where you can open a new window and then
refresh the parent window when the child is closed? this would then have
the items listed.

Dropdown Lists From A Mysql Db
Id like to load a drop down list from a mysql database using php3 and create a link to that record. Does anyone have any ideas?

Mailing Lists Under Apache
I must develop mailing lists under Apache but I don't know how to do this, so, if someone knows how to do this.

Drop Down Lists And Variables
I have a dropdown list with values and I am having trouble getting the value chosen into a variable so that I can use it in an if statement.

Multiple Lists Selection
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. If you let me know which code to post, I will post it.

Multiple Selection Lists &
I have 2 multiple selection lists. I am using javascript so that users can select items from list 1 and move them to list 2. When the user submits the form I need my php to get the values he has/she has in list 2...

I have done printf($_POST['list_2']) and it only shows one value, even when multiple are selected. I read that I need to change it's name to list_2[] but if I add the brackets to the name my javascript quits working.

Dynamic Dropdown Lists
I am recoding a greeting card website.

I am using dropdowns as filters for items in a DB, so when the user picks "animals" from the "theme" dropdown, the returned cards all feature animals, and when the user picks "birthday" from the "message" option, the returned cards all feature birthday cards.

However, there are some combinations that don't return any results, for example "get well" "floral" cards. Code:

Classes And Dropdown Lists
The class below works fine. The problem I have is there's a dropdown list in the middle of the loop. The dropdown list gets its data from another table in the database. Which goes through the same class. So I have a loop within a loop.

What I'm trying to do is ....

Create State-cty Dropdown Lists
I've gotten everything up and running except for this -- I'd like to
be able to have people have a dropdown list of cities in the US to use
(or wherever) and not have to input them manually into a text field.
When you do then there are issues of misspellings, etc.

Now I have a list of cities from each state that is a sample that
works in an html page. Problem is that it takes up 2 MB! Way too much
to load on a single page and I was wondering how this is accomplished
best -- do people use javascripts that can pull information from
another flat flie? Do people use PHP to connect to a mysql database
that might have a list of these fields and then reloads the page?

I'm really not sure of best options and would be grateful for anyone
to give me pointers or whether there are other examples and even
places to buy these databases (not likely but good to have if I decide
to do so.)

Session Info And Pull Down Lists
i have a html pull down list (<SELECT etc etc <OPTION VALUE .....) and
i have the particular value the user last chose it to be in a
$_SESSION['value']. How do i set the selected item of the list to this
one? I can just add it in as the selected item of the list but then it
appears twice.

If You're Good With Arrays And Lists, This One's For You
I'm using PHP 4.4.4. Let's say I have two scalars, $list1 and $list2.
Both are comma separated lists of ordered, unsigned, unique integers.
An example would be

$list1 = "2,26,345";
$list2 = "3,4,26,35,525";

I am wondering if there is a short way of determining if all the
numbers in $list1 occur in $list2.

Creating Form 'select Lists' Using PHP
Is it by any chance possible to use mysql and php to auto create the
content for drop-down lists on forms by retrieving the values from a
database? The reason i ask is that on a site i am making i am asking
users to select from list (e.g. nationality) however i would like to
avoid typing out every possible value of which there are about 40
(which change). I would much prefer to keep a seperate table in my
database for the site.

Sorting Alphabetically Backwards Lists
This code runs @ http://www.ckoogle.com but the trouble is once I get
the list backwards, and in an array. I can't sort the new array into
alphabetical order. Anyone know a way to do it?

<?php

echo '<form action="index.php" method="post">'
echo '<textarea name="input" cols="12" rows="20">'
echo '</textarea><br>'
echo '<input type="submit" value="Submit">'
echo '</form>'

if( isset( $_POST["input"] )){
$my_array = $_POST["input"];
$my_array=strrev($my_array);
$my_array=explode("
", $my_array);
print_r($my_array);
sort($my_array);
print_r($my_array);
for($cnt=0; $cnt < count($my_array); $cnt++)
{
echo(strrev($my_array[$cnt]));
echo('<br>');
}
}
?>

How To Get Hotmail/Yahoo/Aol Contact Lists ?
is there anyone familiar with the part how does most of the match
making sites/schedular websites are accessing your Hotmail/Yahoo/Aol
address book and even inviting your friends rather choosing one by one
from your address book manually by you and make you be in the same
Network?

Auto-update Shopping Lists
I have a shopping list, or multiple shopping lists, that users and sort and add/delete items from.

I know how to add/move/delete items, but that is with a submit button. Is there a way, probably through AJAX, that the mySQL tables will be updated automatically as things are changed?

Pulling Options Lists From Mysql Tables
I've set up a form to load data into my db, but rather than hard code the options lists for three of the form fields, I'd like to pull that information from three lookup tables. This will allow whoever is inputting data to do a simple update for the three lookup tables, and speed enter the data into the form for the fourth (data) table without having to alter the code in the form.

Here's the wish list. The three lookup tables have a key field and a description field. I want to display the description field content for selection by the user in the form (for example, from EventClass table,

display "Single Pony" and return "1" to the CompClass field if Single Pony is selected
Display "Pair Pony" and return "2" to the CompClass field if Pair Pony is selected
display "Single Horse" and return "3" to the CompClass field if Single Horse" is selected
(etc.)

in EventScores), and have the key field content loaded with the data into the data table. Once I've figured the coding for one, I can duplicate the effort for the other two tables.

I have seen PHP coding inserted inside php code. I've never seen this particular practice in any other language I've programmed in. Is this how a connect/query is handled inside a form which is inside a php script? <?PHP <form><?PHP ?> </form> ?> ??

To put it another way, I want to retrieve the data from a table and display it in the options box of the form. Then, when a option value is selected, I want the key for that value returned to the table in which data is being loaded.

One Result Set Makes Two Lists With Same Keys And Values
I have a page with two drop-downs, each listing the same employee names
and their id's as the values. So they look like:
<select name="selection_1">
<option value="12">Curly</option>
<option value="8">Larry</option>
<option value="36">Moe</option>
</select>

....then further down the page:

<select name="selection_2">
<option value="12">Curly</option>
<option value="8">Larry</option>
<option value="36">Moe</option>
</select>

Currently I am doing this, which works but seems sloppy:

<select name="selection_1">
<?
while($employees=mysql_fetch_assoc($qry_rslt)) {
/* ADD NAMES TO DROPDOWN WITH emp_id's AS THEIR VALUES */
?><option
value="<?=$employees['emp_id']?>"><?=$employees['name']?></option><?

/* CREATE ANOTHER ARRAY WITH THE emp_id AS THE KEY */
$emp_list_2[$employees['emp_id']]=$employees['name'];
}
?>
</select>

Then on the second drop-down:

<select name="selection_2">
<?
foreach($emp_list_2 as $key => $emps) {
?>
<option value="<?=$key?>"><?=$emps?></option>
<?
}
?>
</select>

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.

Detecting Host URL.
I've got a site that has both secure access (https) and normal http access. both use the same index.html.

The problem I have is that I cannot find a way to check which method is being used to access the site.

Ideally I want to check for https access and if that's not being used, redirect to the https url.

Anyone know of a way of doing this in PHP?

Detecting Frames With PHP
Is it possible to use PHP to see if the person who is accessing ur website is using the frame set up or the non frame set up?

Detecting Flash
I need a way to detect whether someone has flash installed. I will use this information to take them to two different pages depeding on the result.

Detecting Recursion
Say I have an array containing a reference to itself:
$myArray = array();
$myArray['self'] =& $myArray;
How can I, looping iteratively through the array, detect the fact that
$myArray['self'] will "take" me to where I have already been? The print_r()
and var_dump() functions print *RECURSION* in such a case (though only after
the "second round"). Setting a flag seems to be the only solution, but I
don't want to modify the array in question - I want to produce a visual
representation of its contents like var_dump(), but formatted to my taste. I
had considered parsing the output of var_dump(), but first, that format
might change in a future version of PHP and second, an array key might be a
string resembling part of the output (like $myArray['["myArray"]=>']), which
seems to be difficult to detect by the parsing code.

Is there another way of doing this?

Detecting Domain?
how I can use PHP to detect the domain that is being used? Or just detect the full URL? Because I have more then 1 domain and I want to redirect the others to the first one, so that google won't think I am using duplicate content and penalize me for it.

So like either a way to detect what the domain is (E.G. domain2.com) so that I can redirect to domain1.com

Or just a way to detect if it ISN'T domain1.com, and redirect to domain1.com if it isn't? Because I like to register more then 1 domain for common misspellings, like the way google has gooogle.com redirect to google.com

Detecting The Name Of The Page You Just Came From
I know there is a way to detect the name of the page you just browsed from, but I cannot seem to find it.

Problem With Detecting Speed Of Net.
Well i comes accross little bit tricky problem around in php..there is any way to detect net speed in php ?

Waiting for some one to reply

Detecting Sum Of Array = 0 Problems
I use the following code to put directories that are on the server but not in the database yet on my website, so I can use a function to have them added.

However, when all my directories are in the database I get just an empty page, I want to put in a nice line that says all dirs are already added.

I don't know why the following code doesn't do just that. I tried several other things, no luck yet.

Do you have any idea what goes wrong, or how to solve this?

Detecting Windows Servers
Is there a way, within PHP, to determine if it is running on a Windows
Server?

Detecting If There Is A Mobile Phone
Is there a way (maybe a variable) to detect whether the user is using a mobile phone with internet to view your website?

Detecting Browser Resolution
How can I detect the resolution used by a visitor (i.e. 640x480, 800x600, etc.)?


Detecting Multiple Sessions
I have an address database running on POSTGRESQL web based ofcourse with php. My Web application has a login page that gives the users a session_start if their data is correct. Users can login at the same time. I would like to know how i can detect the session from these users. Than i want to know:

- How many user are online
- Wich users are online

When they didn't logged out but have closed their browser, how can i detect if their offline?

Detecting User-Agent
I have a site that uses access-restriction to only allow registered users to view certain pages. However, I would really like Google to be able to index *every* page regardless of whether it's password protected or not.

Is there a way to identify the user-agent header in PHP? That way I could identify the Googlebot, and then set a session variable that would allow the Googlebot to spider my entire site.

Detecting URL Forwarding / Redirection
I'm working on a feature in my software that will delete urls from a database if they no longer exist or do exist, but are redirecting to another page. Both cases have a setting to optionally allow a user to delete or keep them based on either one of the two scenarios. My problem is the header status which is being returned and detecting which urls are forwarding - For example,

Page 1) This no longer exists - HTTP/1.1 301 Moved Permanently

Page 2) This page is redirecting - HTTP/1.1 301 Moved Permanently

Page 3) This page is available - HTTP/1.1 302 Found

So page 1 & 2 are showing the same header status, even though page to really does exist.
Any suggestions?

Detecting User Country?
Is there a way using PHP to detect the country a person is browsing from?

Automatically Detecting Tables In A Db
Is it possible to write a script that, when provided with a database,
it will return all the tables names?

I will go onto try and put together a script that will not only output
the table names but also output the sql code required to CREATE the
table (i.e. CREATE TABLE example (exampleid auto_increment not null
primary key integer, name text, email text);) - Is this pretty simple
to do? Are there any free scripts online that would do this?

Php Detecting Javascript Enabled
Is there any php script to detect if java or javascript is enabled?

What is a difference between java, javascript and applet?

Detecting And Displaying The Domain Name
I have a site that has several domains pointing to its DNS.
I would like to implement a script that will grab the domain name visitors typed in, and display it
on the page. Is there a way to do it?


Detecting Multiple Windows
How would a man go about checking if another window (or tab.. same thing) is open from my site? Not allowing the pages (other than that 1 that is allowed) to load, thus showing an error.

Im doing this as more of an expieremental thing, but I have no clue where to start with it. I don't even know if PHP would be involved. Anyways, I've searched and searched and I couldn't find any examples/tuts so I came back here.

Detecting If A String Has A Certain Character?
Is there any sort of function to be able to go through a string and return if there is a certain character in it.

I have a variable for a persons name but and i need to know if there is a space between there name or not.

Detecting Dead Images
My database contains the images of other sites.... when other sites remove some images from their websites, my side shows blank images as i am using their images and the same_path of their images.

1) Is there a way i can detect the blank images.

2) Is it possbile that the desciption of that image will appear only when that image is opened.

Detecting User Abort Or Timeout
I'm writing a download script in php. This script sends files using
echo in order to limit download speed. My script has to do something
after connection abort. Everything is ok unless client pauses
downloading.

I'm using ignore_user_abort() and I'm checking connection_status()
while sending a file. When the user aborts connection, my loop breaks
and script finishes its job. But if the user pauses connection, the
script still sends a file!

I want my script to execute some commands after a break of the loop and
not to send file, if the user doesn't receive it! I don't know how to
implement that. Is it possible to do such script?

Detecting All Game Servers Running On LAN
does anyone know of a way to detect all game servers running on a LAN, preferably Half-life servers. Is this even possible ?

Half life the game obviously detects all the servers running on the network but I have no idea how this could be done in PHP.


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