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.





GET, POST, Multi-Selects


When the HTML of a form has a field name 'choices' and has five checkboxes with that name, each with a different value, like this:

Code:
<form name="testform" action="processor.php" method="post">
<input type="checkbox" name="choices" value="One">One
<input type="checkbox" name="choices" value="Two">Two
<input type="checkbox" name="choices" value="Three">Three
<input type="checkbox" name="choices" value="Four">Four
<input type="checkbox" name="choices" value="Five">Five
<input type="submit" value="submit" name="submit">
</form>

In PHP, without altering the HTML at all (assume that I have no control over the HTML because there will be remote forms already coded by others that submit to this script) if I look at the values through the PHP-approved method (assuming that every checkbox was checked by the user), I see: Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Dropdown List Which Selects A Post A Title (to Edit)
I want to have a dropdown list which selects a post a title (to edit), then when you click submit I want to use POST to submit the data for that post (post title, username, subject, content) so that the edit pages form fields will already be filled with the posts data.

View Replies !
Multi Demensional POST Array
$_POST['array['$variableneedstobeputhere']']what is the syntax for this?

View Replies !
GET / POST Conflict In A Multi-page Form.
Wonder if anyone can help with this problem:

I am using an app with several pages, using a session to track vars
between the pages, and using an image map to re-direct back and
forwards between the pages.

The way I redirect is when the image map is clicked on, it posts to a
page called 'control.php' which passes the POST vars to the
corresponding SESSION variables, then redirects to another page, based
upon the co-ords of where the image map was clicked upon.

I have added text links at the bottom of the page:

i.e.

<--- previous page

----> next page

but because the image map POSTs the data to 'control.php', I can't
really add a GET query string to the link at the bottom of the page,
because nothing will be POSTed.

....But then again, I can't add a POST link to the HREF, because it
won't pass the co-ords, and I can't add a special variable to identify
the link to the control form -i.e. control.php?link=3 (as I could with
a GET) and re-direct accordingly.

So, after hours of thinking about this, I'm stumped.

The only idea I have is to hack the image map up into smaller pieces,
add ALT tags to each one, and make do with it - or add NEXT and
PREVIOUS submit images at the bottom of the page too.

If I make do one with large image map, it is no use to someone who is
visually impaired and relies on ALT wordings.

Is there any possible way to achieve what I am trying to do ?

View Replies !
Sending A Multi-part POST Using Fsockopen
I have a php processor script that loops through an xml doc, extracts video data (names, file names...etc) and does a bunch of other stuff. Within this loop I need to have the script perform a "POST" basically emulating an HTML form but ofcourse in this case I do not want any HTML.

I understand there are (mainly) 2 options to do this: fsockopen and curl. I would like to use fsockopen if possible, so I can get an http response code and hopefully analyze it when applicable.

I have tried to do this using fsockopen for a little over a day now with no success. I've read various posts and tutorials, but with no success so far. I know I could be missing something simple or maybe complex, I do not know any more, I'm going crazy with this Can you please give me some guidance on how to send a POST using fsockopen for this situation:

lets say I want to send 3 pieces of data: clipTitle='Funny Clip', clipDescr='this is some descr', clipCategory='humor'
and I want to send (as if i'm uploading a file) file='1234.mpg' this file resides in the same dir as the script running this fsockopen.

View Replies !
Processing Data From Multiple Multi-line Textareas Into A Multi-dimensional Array
I know that this sounds like something overly complex - because it is.
However, if I can keep the user interface the way it is, my users will
be ultra happy! That is the goal...

In general, this is an inventory receiving piece of an overall larger
web-based ERP system.

What I have is a form in which I have a dynamic number of multline
textareas for inputting (possibly barcode scanning in) many serial
numbers per line item recieved.

For example:
lineitem01 = widget01; qtyReceived = 2;
lineitem02 = widget02; qtyReceived = 3;
lineitem03 = widget03; qtyReceived = 10;

This would display a form that will generate 3 textarea elements (1
per lineitem received). Inside each textarea element will be input the
serial numbers for each of the widgets received per lineitem. i.e. 2
serial numbers will be entered for widget01; 3 for widget02; and 10
for widget03;

So, what I am trying to do is pass this data over, possibly as a multi-
dimensional array to another form ( or possibly $_SERVER['PHP_SELF'] ) to update a MySQL database to store the widget/serial numbers.

View Replies !
Multi INSERT To MySQL Database From A Multi Input Form
I need to make a form like:

ID1 - TITLE1 {input=text}
ID2 - TITLE2 {input=text}
....
I'm gonna make changes some of the inputs not all of them. And when I submit form, changed rows will be inserted to another table. I think its an array and for loop thing but I couldnt figure out the code.

View Replies !
Selects
How come my second select form is blank for the first option? I realize the problem is when I put in the $series_design tag, but I don't know why.

View Replies !
Structure Of Multi-user/multi-section Admin
I'm trying to work out how to structure a multi-user/multi-section admin and it's a bit of a puzzle Here's the set-up I need:

There are two types of Admin : superadmin and admin - the superadmin has access to all but the normal admins are limited to what they can see - and it's the superadmin who sets the permissions.

The site has 5 dynamic sections (this doen't change) and inside each section there are a variable number of subsections that are managed by the superadmin Code:

View Replies !
Multiple Selects
I want to do a multiple select like this where the user can select multiple items

<SELECT NAME="abc" MULTIPLE>
<OPTION VALUE="A">A
<OPTION VALUE="B">B
<OPTION VALUE="C">C
<OPTION VALUE="D">D
</SELECT>

How do I reference these variable in code or the form that does the processing?

View Replies !
MySQL Selects
I just made my first sql database and PHP interface for it last week I'm getting pretty far with it however I'm having a problem with the select statement. It's looking like this:

SELECT * FROM freehosted WHERE website='$website' AND type='FHG' AND category='$category' OR keywords LIKE '%$category%'

This is working good, however I ONLY want the website designated in the $website variable to display. Code:

View Replies !
Bypassing Selects
I have a profile system which allows members to input info and save it to the database for there profile. A few fields are SELECTS. From Sexuality Favourite Music, So for instance From (England, Scotland, Wales, Ireland) THat works fine, but what happens if someone makes a html document and injects code"

<OPTION>HACK HAHA</OPTION>

Then posts it to my php that excutes and writes to the database. In essance they can bypass the select I have and input what ever data they want. Whats the best way around that, I was going to use a SET in the database structure but one of the selects has about 90 options.

View Replies !
MySQL Selects
what's the most efficient way to grab a single data value from a table field using PHP. the best I have is using a while loop -- but something tells me there is a cleaner/more efficient way:

$sql="select countryType from c_countries where userid={$_SESSION[userid]}";
$result=mysql_query($sql);
while($row=mysql_fetch_array($result)){ $userCountryType = $row[countryType]; }

View Replies !
Multi Sorting Multi Dimensional Array?
I have been using usort to sort my multi dimensional arrays ...

function cmp($a, $b){
if($a[0] == $b[0]){
return 0;
}
return ($a[0] < $b[0]) ? -1 : 1;
}
usort($searchResults, 'cmp');

Which works fine, but I need to sort by one element in the array, then
another, preserving the previous sort.

lets say the array is as follows:

array[0] = array[0] = foo
[1] = 2
[1] = array[0] = foo
[1] = 0
[2] = array[0] = bar
[1] = 1
[3] = array[0] = bar
[1] = 0
[4] = array[0] = foo
[1] = 1
[5] = array[0] = bar
[1] = 2

Initially, I sort the array in to groups based on array[?][0] using
usort as above so the output is :

foo, 2
foo, 0
foo, 1
bar, 1
bar, 2
bar, 0

Next though, I would like to sort this output by number (array[?][1])
in the groups so that the output is :

foo, 0
foo, 1
foo, 2
bar, 0
bar, 1
bar, 2

Is this possible? I am completely at a loss as to how to do this ...

View Replies !
MySQL Question (sub-selects)
I've seen a few posts about getting around the sub-select problems with MySQL. I am trying to do a "NOT IN" type select, as follows:

SELECT
email
FROM
orfcustomers
WHERE
customerid NOT IN
( SELECT
c.customerid
FROM
orfcustomers c,
orforders o
WHERE
o.customerid = c.customerid
);

Basically, I have a customer table, and an order table, and I want all customers' email addresses that have not yet placed orders.

I can't find a reasonable method for doing this, because I haven't had much experience with the INNER JOINS and LEFT JOINS, etc. Also, the tables each have over 40,000 entries, making it a little weird.

View Replies !
Dynamic Form Selects
How do you make dynamic for selects in php? It is in regards to a modify type scripts im writing in php/mysql.

So regular select drop downs look like so:

<select name=genericselect>
<option value="1" selected>1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>

right, well if I was pulling info from a database, how would I make is so that the 'selected' value is dynamic and comes from the database? Im sure theres a simple way of doing this.

View Replies !
Selects All Of The Check Boxes
how would i make it to where someone can press all and it selects all of the check boxes in the area.

View Replies !
Dropdown Selects From $_POST
I'm still working on my form, and part of the form is an age select dropdown. I'm leading them through an approval process and if they'd like, returning them to the form to fix any errors.

The only way I know of having it show up correct in the dropdowns is to do an if statement on each option from the $_POST data. This is cumbersome, as I have 3 selection boxes with many options in each. Is there a better way to do this than to create an if statement for each option?

View Replies !
If Statement Thats Selects Whether $s Is Chosen
I have an if statement thats selects whether $s is chosen or $t is chosen or $u is chosen, if $s is chosen i want the values of $t and $u to be '&nbsp' so if $t is chosen i want the value of $s to be '&nbsp' and $u to be '&nbsp' and yes you've got it now if $u is chosen i want the value of $s and $t to be '&nbsp' Any ideas my codes below:

if ($val=='Currently In Place') $s='X'
else if ($val=='Required Essential') $t='X'
else if ($val=='Required-Recommended') $u='X'

View Replies !
Handle Selects W Multiple Values
does php 5 have a problem with html select lists which allow to choose multiple items?
Whatever I tried I just can't get another or more than the last item selected in the list. Even if I select multiple items, a print_r($_POST) just shows the last selected item, and not a array of all selected values.

View Replies !
Number Format - Selects Prices From A Database
I have a loop that selects prices from a database, prints each price out individually and then adds it to a variable, the "final price".

$thisprice = $row[ITEM_PRICE] * $row[SEL_ITEM_QTY];
$thisprice = number_format($thisprice, 2);
echo("$thisprice")
$finalprice = $finalprice + $thisprice;

But for some reason, when the $finalprice variable is set to more than $999, it won't display the correct price. Does anyone have any idea why this is? Does it have to do with the comma in the price? How can I fix this?

View Replies !
Master FORM Which Selects Between Slave FORMS...
I wish to have a simple multi-dropdown donate option, the user selects a pre-defined amount from dropdown1 then they choose the payment gateway (paypal, stormpay, e-gold, intgold etc) from dropdown2, then click Go!

However, each of these gateways code is embeded on the page as a form (as buttons, no input required).

Is there a way to use a "master" form in php, which selects between multiple other "slave" forms via a dropdown select and submits that value?

I also need a dynamic "payment amount" as dropdown menu (or text input) menu which inserts its value (amount to donate) anywhere on the page as a dynamic php include... (including form value fields) so when the master form is submitted, the "payment amount" include will refresh the value within any of the sub forms vaules upon submitting the MASTER form.

View Replies !
Nested Selects - Works In Mysql, Fails In PHP
Not sure why its failing. But if I run this statement through phpMyAdmin it works fine, but when I drop it into my php file it generates the following error. Code:

View Replies !
User Selects Browser Back Button
I using a alert JavaScript message to display once an user submits a form, the message displays fine, but say the user goes to another screen and hits the browser back button, the same message displays again, is there a way to clear the message once displayed the first time.

View Replies !
Updating Database - Selects All The Data From The Master Table
We have pages that allow the user to enter information. The data is stored in or comes from an oracle table that is not denormalized. This information is gathered on 3 pages and on the 4th page we show a summary and then update the database. My job is to add a new page before the summary page. However, the data I am gathering is in a normalized table that is linked to the other table with a foreign key.

The developer who wrote this selects all the data from the master table on page 1. The columns are all prefaced with 'AP_' and he uses the following code:

View Replies !
How To Display Html Form Selects (via Checkbox) In Email?
I have a simple form to collect user selections in html form. I am
pretty new to php...how can I send the user's checkbox selects to me
in an email...I am struggling with buiding an array to send this info...

View Replies !
Selects The Item And Check Out/in Date And Time To Add A Reservation
It is a simple equipment check out calendar; the user selects the item and check out/in date and time to add a reservation. When I add a reservation on an item, I'm getting this error message: Code:

View Replies !
Mysql SELECT Query That Selects The Latest Items
I am building a website that has a software download category, and has news on the main page. Now I have two tables, named "news" and "software". On the main page I want to select the latest 40 updated items, so whether it is a newspost from table "news" or an extra entry in table "software", or an updated version of an entry in "software".

They are all INT types holding a time() string. what I want is a mysql SELECT query that selects the 40 latest items.

View Replies !
How To Populate Selects With Years=>months=>days That Dynamically Change?
What I'm thinking of doing is in my admin page have three different selects. They will form the day of sales at my shop.

-YEAR- -MONTH- -DAY-

The years will have 2002 -> 2005 and the months will be the 12 months of the year of course but I need the number of days to change with the particular month selected.

View Replies !
Construct A Dynamic Navigation That Expands When A Visitor Selects A Sub-directory.
I am trying to construct a dynamic navigation that expands when a visitor selects a sub-directory. The site has 6 sub-directories, plus the root. Is there a way to use a wildcard or something, to indicate all contents of a directory?

For example (this does not work):

<?if($_SERVER['PHP_SELF']=="/cars/*"){?>

Anyone know of a solution? What about the root level, is there an option for that too?

View Replies !
Multi User/ Multi Page Redirect To Particular Clients Page
I need all of my clients to be able to go to ONE login page. based on their user ID number and password be able to login to their particular page, I do not want them seeing any of my other clients information. seems easy... now why cant i figure it out.

I want the back end of it in mySQL, with a way for: admin to easily update the information located in there...ie: go to client 1 add new invoice information, new expiration date, etc. clients to easily update their billing information, etc from their personal page, is a must also. I just want to know if going with PHP is the best bet, or if there is another way..

View Replies !
Dropdown Date Selector That Automatically Selects Todays Date
Does anyone have a PHP generated dropdown date selector that automatically selects todays date on page load that i can pinch?

View Replies !
Fill Fields When User Selects User From DB
I have a field with a selectbox which contains a list of client names and several other fields which display information from the DB.

I need to be able to make the fields change to the appropriate information when a user is selected from the select box. Can anybody please give me an example of a bit of code that will do this?

View Replies !
Post And Redirect With Post Data
The solution we have though up is the following:

1. The user fills in data in a form and hits submit
- This submits (POST) to another page (redirect.php)
2. redirect.php adds more POST data to POST and then submits all this POST data to another page (offsite [payment portal])

The reason why we have to do this is for someone who knows our to read html source code, could easily find the sucessful page which will then do the processing we need to do on our side. Which means freebeis.

View Replies !
Calling A Post Script From A Post Script; Curl Works But ...
I am trying to call a php script B from script A.

However, when I do this with curl everything works fine except the url of the script is the url of script A. How can I make the URL the URL of script B.

Is this possible with curl?

View Replies !
PHP Post, Then HTML Post?
Using PHP, I want to POST or GET some variables to a second php page.
This, I already know how to do.

However, on the second php page, I want to use a simple, standard HTML
form using the standard form-submitting method such as:

<form action="https://orderpage.ic3.com/hop/orderform.jsp"
method="post">

whereupon both sets of variables --- the earlier variables that were
POSTed or GETted to the second page, along with the standard form
variables derived within the second page --- will be POSTed to the
above URL.

In the second page, might I actually translate the received variables
into actual HTML code? For instance, if my first page POSTed the
variable xyz to the second page, then might the following code on the
second page receive that variable and then include it when the second
page's "Submit" button is pressed?

<? $xyz=$_POST['xyz']; ?>
<INPUT TYPE="HIDDEN" NAME="xyz" value="<?=$_POST['xyz']?>" >

Or how, otherwise, might this be done?

View Replies !
POST :: Post Files More Than 4 MB
I have post problems. Whenever I post files more than 4 MB it does not upload files on my local server. It just does nothing. tried to set the

post_max_size = 10M;
max_execution_time = 100;
memory_limit = 250M;

in the php.ini.

View Replies !
Multi Logins
I have multiple scripts running on my site, both CGI and PHP. I was wondering if there was a way that would automatically apply logins throughout the site with only one entry point. Without the use of cookies, since some of my users don't have safe computers (i.e. the family computer).

Or should I start from scratch and rewrite the entire site in PHP?

View Replies !
PHP CLI In Multi-threaded??
I'm looking information abouth runing PHP CLI application in
multi-threaded - on http://www.php.net/manual/pl/ref.pcntl.php i found
information abouth process control - but is PHP support multi-threaded...

View Replies !
Multi Language
I have thought a bit about how to implement multi language on a site. It seems to me that there are to ways.

1. The gettext method. That is, create a class for every supported language.

2. Put the language into the db.

Now there are to ways that I could walk to find my wisdom in this area.

1. Try both methods an see which is best.

2. Ask someone else what they think.

I have alot of text on the site.

View Replies !
Multi Threading
how to acheive multithreading in P.H.P.?

View Replies !
Multi Catagorisation
i have built a business directory script, some buisnesses need to be in more than one catagory, i want to store the catagory info like this. 1,6,34 , how can i make a smart query to recognise that format as 3 different catagory numbers?

View Replies !
Multi-platform
I have a large project coming up and I am comtemplating using a PHP/MySQL combination to handle the dyanimcs of the data. The project will, however span across multiple platforms and devices, which I have listed below. I need to know if anyone has had any luck with a using PHP on the following devices:

Intranet - Windows XP Pro based
PDA - Palm OS
PDA - Windows CE
MS tablet PC - Windows XP tablet PC edition
Possible cell phone incorporation to come in the future

I am torn between using a PHP/MySQL/XML combination or just using a.NET solution.

View Replies !
Multi Layouts
I'm working on a website and it's going to use two or more layouts and now there's a problem with this cause I don't want have the content files (body text, images etc.) duplicated.

For example layout 1 is located at /website/layout1/ and layout 2 under /website/layout2/ and so on. And wouldn't want the content files in each folders, takes alot of time to modify them. I guess I could store it on a MySQL database but I don't got any code for that ready and at this time it seems easier working with files.

Anyone know how this can be done with or without a database? The user will be able to choose layout through a form so it will be using cookies, but hasn't worked with cookies much personally so any tips would be nice .

View Replies !
Multi-Language
i was trying to make a multilanguage system for my web site and got into trouble
this is how it looks like PHP Code:

View Replies !
Multi Threaded?
How much traffic can PHP handle? Is it multi-threaded.

Does someone have a feel for this from prior experience?

View Replies !
Multi-threading In PHP
Can any one give me idea on multi-threading application in PHP? PHP supports multi-threadin? How to develp a multi-threading applications in PHP? give me one example.

View Replies !
Curl Multi
I am very interested in curl_multi, but have been unable to find much information on it at all. For something so tricky and powerful, it seems to be quite badly documented. (Or I suck at Google. One of the two.) Does anyone know a good article on curl_multi?


The only decent example I managed to find was posted as a comment in one page of the PHP.net manual. This would appear to fetch three urls, and seems to have scope to be easily scaled. However, there's some real issues I have here, and I need help understanding them.

I assume in the below code that at the end you can access these pages as $res[$i]. But to put this to practical use I would really like to know if this could be used to process pages *as they come in*. I run a specialist site using spiders in real-time to fetch info, and I need to show the first results as soon as they come in. I can't wait for all of them. Is there a way to process info as each individual handle is ready? Also - Is there a way to identify the URL of the site, as well as the content? Code:

View Replies !
Multi-threading
what are the steps that i should folow to run a (child)thread from the parent process ?

View Replies !
Multi Emailer
does anyone have code and files for a multy emailer php of corse that i can add as many emails in the reciept as i like and send a auto message thats built in to the code.

View Replies !
Multi Threading?
I didn't think this would be hard to find out but I haven't been able to find anything useful on the matter how to multi thread in PHP. Like for example so I can have PHP doing something else in the background while waiting for a long mysql query to complete.

View Replies !
Multi Select Box
how to store multi select box values in database.suppose one person prefers 2 or 3 cities in a country.during the normal process last selected value is stored in database.but i want to store all selected values in multiple select box.

View Replies !
Multi-Classes
I have 3 functions files, I want all of then to share their information, I'm using a class.

functions.php - class UNDERIO
functions-city.php - class CITY extends UNDERIO
integrate/ipbsdk_class.inc.php - class IPBSDK extends UNDERIO

They are all "require_once" on that order. When I do $UR =& new IPBSDK();
Only the functions from functions.php and integrate/ipbsdk_class.inc.php are gotten, how can I make the ones from CITY come too?

View Replies !

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