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




Conditional Form


I want to condtionally display an HTML form. I havnt got a clue how it can be done, I suppose its the same way as putting html tables in php, but I cant get it to work. Here is the condtion:

<?php 
 if (!empty($pk))
  {    

And here is the form:

<form action="google.php" method="GET" name="deleteForm" >
<input type="hidden" name="pk" value="<? echo $pk;?>">
<input type="submit" value="Delete">
</form>




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Mutlipart And/or Conditional Form
I have a form that needs to have conditional statements, and I am not sure how to "fix" this. The existing form is split in two parts - the form, and the processor. I would think that I will need to combine them, but..

Anyways - what I need is somewhat simple - if a certain option (from a <select>) is chosen, force another field to be completed. I also have 2 other fields that if the radio button is set to YES, require new fields. Ideally, the optional fields would only be shown to the user IF they are required.

Syntax Issue With Form And Conditional Statement
Is it possible for a <form ... action="program.php"> to contain a conditional statement for the action? For example, I want to call one PHP program if variable $a="screen" and another program if variable $a="download". I have been struggling with this for some time and cannot seem to get it to work.

Conditional Loop
I have one table, "players" that has player info including start season (year). I then have a table for each season with player stats, i.e. games played etc called stats200X where X is the year obviously.

I have no problem with extracting data from the current year, but what I would like to do is get data from previous years too. I was thinking about doing something like:

(year) - (startyear), which for example could be 3.

I don't know where to begin, but I want to be able to loop though previous years so that, if tables exist of course, I could do

select * from stats{Y -1}
display
select * from stats{Y -2}
etc

Would I need to hard code this or is there a way of doing this though a conditional loop?


Conditional Login..
I have a form with a username & password field along with 3 radio buttons.

What I basically want to achieve is if radio button A is checked it will post the username & pass to a.php, If button B is checked it will post the username & pass to b.php and so on for button C.

Checkboxes,conditional
Basically I have what seems to be a very small problem but I am driving ny self mad trying to figure out what the problem is. Here is what I have: I have a form with two checkboxes:

<input type="checkbox" name="medicalcheck" >
<input type="checkbox" name="dentalcheck" >

the form is posting the a php file, decision.php, that simple checks to see if the boxes have been checked and performs an operation in either case. Here is the code:

Once Conditional Causes Error, The Other Doesn't...why?
There are 2 if statements at the beginning of this code snippet.  The one that is currently commented out works while the one that is not commented out yields this error

Parse error: syntax error, unexpected '{' in C:xampphtdocsench2index4.php on line 106

I am just not seeing why. Code:

Conditional Structures
I am wondering about conditional structures and the depth of nesting allowed, if at all. For example I know I can do this: Code:

Conditional Third Expression In For Loop
Is it possible to make expr3 $i++ under one condition and $i-- under another? Instead of having the condition outside the loop and having two loops. Or I could just use a while loop, I guess.

Sessions + Conditional Include
I am having a little problem in trying to figure out why my session state is not expiring after I close the browser window. Having been used to the ASP way of doing things I am trying to get my head around this slightly different method of handling sessions in PHP....

What happens is that I log on to the site, do various things and then close it when I am finished. I return the next day to find that the 'logged in' menu is displayed first which shouldnt happen until you have logged in again.

I assumed that the session was been stored as a cookie but wasnt been released after the session terminates by default, but found I was wrong when I deleted all my internet files and went back to the site.

My code for the first page is as follows..

Conditional PHP Cookies; If Cookie = 1 Do This...
I've figured out cookies ... now I'm trying to combine them with if conditions.

For cookie 'bandwidth1' I want to echo that it is set to 1 by the cookie to confirm this in the brower through regular html.

My if/else statements don't seem to be working though...heres the code I have now.

<?php
setcookie("bandwidth1","0",time()+2592000,"/");
setcookie("bandwidth2","1",time()+2592000,"/");
setcookie("bandwidth3","2",time()+2592000,"/");
?>

<?php
if (isset($_COOKIE["bandwidth1"])=="1")
echo "Bandwidth is 1!";
else
echo "Bandwidth is unknown";
elsif
echo "Cookie was not set?";
?>

MySQL Conditional Statement
What I am trying to do is kind of like an advanced search. Basically, I have three dropdowns, for this I am going to use the example books: Three dropdowns, which are

1) Author
2) Language
3) Type (Hardback or Paperback)

Typical search: I want to get a list of all books written by STEPHEN KING, that are written in ENGLISH and that are HARDBACK ok fine, but what if I just want to search for ALL books by STEPHEN KING regardless of the language or the type of book?? Heres the SQL i would use for all 3 "search parameters": PHP Code:

Writing Conditional Statement
I'm trying write a conditional statement that updates the database in 1 of 2 ways depending on the values given. I'm only 2 weeks into learning PHP/MySQL so I realize the way I've written it out is probably sloppy and more inefficient than what it could be. I've just been winging it from examples and trial and error and have gotten everything working except for this. I'm not sure if I have my logic or syntax wrong.

Application-specific details:
This is a simple invoicing application. Every invoice is in either 1 of 3 states:

- pending (default state when a new invoice is entered)
- paid (state when invoice is paid in full)
- partial (state when only partial payments have been made on the invoice)

What I'm trying to do is this:

1. If a partial payment is made on an invoice, the status is set to 'partial' (this is working)
2. If the payment posted was the full amount of the invoice or the final amount needed to pay it in full, the status is set to 'paid' (this is not working)

My processing logic works like this:
1. There is a total invoice amount stored in the invoice table represented by $total variable (working)
2. When payments have been made to that invoice (stored in the payments table), I show the remaining balance on their invoice by calculating the sum of those payments and subtracting them from the total (this is represented by the $diff variable and is working)
3. The part not working: When the remaining balance ($diff) minus the payment amount posted ($_POST['amount']) is equal to 0, the status is set to paid. PHP Code:

Conditional Statements And Loops
Not long ago I was asked to give PHP lections to some private IT
school. I'm on second lection now, and will be teaching my :) students
conditional statements (if..else and switch) and loops (while and for).
That was my story, now the question.

Can you give me an advise on some geeky use of those statements to stir
up some enthusiasm in students.

Conditional Select From Mysql
I have a mysql database which stores race data that I want to open up to users for viewing. I want the user to be able to select various subsets of the data according to the parameters: race, gender, age, and type (and maybe sometime, by name as well). This is BOTH a mysql question and a php one, as I ask for a more efficient solution (see bottom this post).

Here is a snippet of how I am implementing the mysql statements to select only the exact subset of data. PHP Code:

Conditional Preg Match
The following bit of code does a preg match and does something if true
(sets $browser to ppcie)

Without using if then and else's how do I code it so it does not equal
what it is testing for? So if it does not find ppc in the $agent then
it does something else/sets it to something else?

$agent = getenv("HTTP_USER_AGENT");
if (preg_match("/PPC/i", "$agent")) {
$browser = 'PPCIE'
}

Question On Conditional Statements
I'm a perl programmer and am trying to learn PHP.

So far I have figured out most of the differences, but have not been able to
find out how to do the following:

When running through a loop, how can you test two separate conditions
against the same $element of an array. For example, this is how I thought it
would be done (similar to Perl), but it did not work:

if (eregi("apple", $line) and (eregi("orange", $line) {

do whatever;

}

Basically testing each line of an array to see if both the words "apple" and
"orange" are present.

Also, is there any equivalent to the following from Perl while running
through a loop:

next if (whatever conditions);
last if (whatever conditions);

Help With Posting Conditional If Statement
I've tried scaling down a script to the bare minimum and
it still is not working correctly. What I think should happen is that when
the field app_fname is blank, that $hold_chk will get set to 1 and the 1st
if statement will be executed. What actually happens is that when I hit
submit, the form stays where it is, for example if the form where the submit
button is located is on the form other.php, then when I hit submit this is
where it stays. If I then hit the submit button a 2nd time, it post to the
some.php form. I've tried this script without the conditional if(isset()
and it works. I need to have the isset() otherwise the form displays all
empty fields as soon as it loads, before the submit button is hit.

<?php

$holdchk = 0;

if (isset($_POST['B1'])) {

echo "<br><br><br>";
if (empty($_POST['app_fname'])) {
$holdchk = 1;
}

if ($holdchk == 1 ){
echo "<form method="POST" action="some.php">";

}

if ($holdchk == 0 ){
echo "<form method="POST" action="other.php">";

}
}
?>

<html>

<head>
</head>

<form method="POST" action="">

When
hit the submit button</font></b<input
type="submit" value="Submit" name="B1"></p>
</form>
</body>

</html>

Conditional List Boxes
I am attempting to create a list box that is dynamically populated based on the selection of another list box.  I am in way over my head..only way to learn I guess.  The code below has a year listbox and then based on the year selection, the page should either show another listbox (show industry selection when year <> 2005) or it should render the main form (when year=2005). I cannot get the main form to appear. Code:

Conditional Email Text To Hyperlink
I am trying to write a content management section for a web site.

I have managed so far to use htmlarea to give users a basic, but user
friendly interface by which to edit the page content.

The user can add emails by symply typing john@example.com - IE automatically
converts this to a hyperlink. The trouble is sometimes the users use plain
text. I have been using the following line to convert plain text to a
hyperlink:

$pagetext=ereg_replace('[A-Za-z0-9_]([-._]?[A-Za-z0-9])*@[A-Za-z0-9]([-.]?[A-Za-z0-9])*.[A-Za-z]+',
'<a href="mailto:?subject=Email%20from%20web%20site"></a> ',
$pagetext);

This works well - BUT it completely screws up any existing hyperlinks. Is
there a way to convert the plain text email address in to a hyperlink only
if it is NOT part of a hyperlink.

Basically I need some way of checking
* If it's plain text > convert to a hyperlink
* If it's already an email hyperlink leave it alone.

I have tried looking up and testing everything I can think of - but am
finally asking around before I go mad.

Simplifying A Basic If Statement Conditional
Is there a more efficient way to write this:
if($var=1 || $var=4 || $var=27 || $var=28 || $var=30 || $var=37||
$var=38){echo "true";}

Avoiding Endless Conditional Statements
Here is my problem. I want to make a webapp that will basically take
the work out of finding what tool works for what situation. There are
5 factors that go into tool selection. 1)Material Group, 2)Insert
Radius, 3)Insert Type and Size, and 2 others that I can't remember
off-hand. There are probably about 1000 different scenarios that I
have to code for..(there are several blank table cells and it's not
setup as you might imagine, there is a lot of overlapping), and I
desperately want to avoid making a gigantic conditional statement. I'm
afraid that I really have to provide a picture of what I'm doing here,
so I will do that. Here is the link.
You only see 3 of the 5
factors on this page, and the other 2 have to do with whether this
table or one of many other tables (not pictured) will be used.

So, now that I've confused everyone. That's my table. What's a good
way to go about programming that sucker in so that people don't have to
do all the "work" involved to figure out what tools they need. They
should just be able to choose selections from 5 dropdown boxes and get
one tool back. A tool is something like "10.655.600".

Cascade Dropdown Or Conditional List
I would like to create a conditional cascade form.  based on the selection, it can display or not display an input form for the user to enter an string of text. then at the bottom of the page (or when a user submit) connect all the sections including the input field all together (it's like a story maker?)

Conditional Statement For Default Case
I'm trying to create a conditional statement for my menu that will check to see if the page is on the default case. Code:

PHP Conditional Setting Of Radio Button Default
I'm working on an edit inventory form, and I'm pulling a field from my database that's going to be a 'Y' or 'N'.  Based upon this, I want to default the 'customizable' radio button to either checked="Y" or checked="N". Code:

Make Function Equal To String In Conditional
I can usually figure something out, but I CANNOT figure this one out: This is a classified word ad script to count the words in a text area ($wrdad) and multiply it by the rate for how many times the ad will run in the newspaper.  I know my code is messy and ameture, don't be too critical, but it works - everythign except one part. We have a 15 word minimum. I have this area commented out as //Problem Area/// in the code below.

In a nutshell, I want function wordcount($wordad) to be equal to 15 if there are fewer than 15 words in the $wordad textarea. It just seems to ignore the wordcount($wordad) == 15; in my conditional. Code:

Conditional "implements"
Currently i'm thinking about how to solve this problem:

if (t3lib_div::int_from_ver(phpversion())<5000000) {
// php4
class tx_lib_object extends tx_lib_selfAwareness {...}
//
} else {
// php5
class tx_lib_object extends tx_lib_selfAwareness implements ArrayAccess, Iterator {...}
//
}

The question is now how to make this conditional "implements" in php?
Of cause i do not want to copy the code for both php versions and then
switch between the whole classes.

Server-Side Form Submission - Form Submits To Form, Which Autosubmits. BAD!
I have a php form from which the user fills out their name and address and clicks "Submit".

The form goes to a page that stores the data in a mySQL database, then, using hidden fields, populates another form and actives with a javascript onLoad=submit() to send the information on to the final destination.

I cannot control or edit the final destinations web page, which is why the interim page is needed.

What I would like is for the user to fill out the form, and upon submission have the data recorded into the database and have the data passed on in a "form like way" on to the final destination BY THE SERVER, not by the use of a hidden form page that auto submits.

Any suggestions?

Here is the interim page's code below:

<?
$link = @mysql_connect($db_host_name, $db_name, $the_decoded_password) or die;
@mysql_select_db($db_name) or die;

$query = "INSERT INTO web_link VALUES ('', '$a', '$b', '$c','$d', '$e', '$f', '$g', '$h')";
$result = @mysql_query($query) or die;
?>
<html>
<head>
</head>
<body onLoad="document.contactme.submit();">
<form name="contactme" method="post" action="http://www.test.com/cgi/storethisdata" >
print "<input type="hidden" name="first_name" value="$first_name"><br>";
print "<input type="hidden" name="last_name" value="$last_name"><br>";
print "<input type="hidden" name="email" value="$email"><p>";
print "<input type="hidden" name="phone" value="$phone"><p>";
?>
</form>
</body>

</html>

Add Form Field Values Into Php Seesion Variable Before Submitting The Form
I have php page which is basically a simple html form containing some text fields.The user will type in values in it and submit it .Now what i want is that just at the time of submittion i want to assign the form field values in session variables.

I nwwd this b'coz the form is being submitted into a cgi script which has been given to me.Now the cgi script is an executable one and i am unable to view or change its content,Its functionability is to change a password for a linux user account .Now the cgi script after completing the job is redirected to another html page.What i have to do is that i need to trap the user input and update the values in a mysql database .Now if i can assign the values in a session variable then i can do the updatation from some later pages.

CURL Form Posting To Self Referencing Form Action
I've successfully used CURL to maneuver around and through sites
but a new site I've been trying to work with has got me stumped.

To retrieve the data I'm trying to get a login is required. If
you go to any page in the "member" area without logging in you
get directed to a https connection and hit login.php (ie: you
end up at https://www.domain.com/login.php). The problem, I
believe, lies in the fact that the form on that page references
itself in the form action tag.

The action tag in the form is "/login.php" and nothing I've tried
has been successful in getting CURL to actually submit the data
and get me logged in. Not surprising really since you'd normally
point CURL to the action target to pass form data.

The things I've tried so far without luck are:

* Hit the main site page to pick up the session cookie then go
to one of the "member" only pages

* Gone directly to one of the "member" pages to get redirected
to login.php

Both attempts end up simply returning me the contents of the
login.php page which, obviously, doesn't help or do any good.

What isn't clear from the CURL documentation with PHP is whether
or not the CURLOPT_POSTFIELDS get passed to pages after a redirect
takes place. I suspect they are but the fact that login.php
refers back to itself seems to be the real problem.

If anyone has any ideas on how to convince CURL to get me past
login.php or any other suggestions on things I could try I would
very much appreciate it.

Form Submission Fills Form Values With Garbage
I'm attempting to do some form processing on a server that has register_globals off, however, I've run into a confusing situation and need some help.

Basically, the form is a multi-part/form-data form as I have it upload a file in addition to submit a number of other fields, but the error I have occurs even when no upload is done.

When I submit the form, all my input field variables get filled with garbage. Here's the html before submission for one of the fields: Code:

Dynamic Form Fields/multiple Page Form?
It is for a friends out of print booksite, where visitors can request multiple books to be searched by adding one at a time to a cart (javascript), then once all added they submit to another form where they enter their personal details and all is sent through. The problem is at the moment they cannot change whats in the cart without refreshing the browser window and losing everything.

1) present for asking how many books they want to search for
2) display multiple rows of the same input fields depending on how many books they say they want to have searched for?i.e

title|author|publisher|etc
title|author|publisher|etc
title|author|publisher|etc

3) when these are submitted they could see these above the next part of the form where they enter their details with the option to go back and delete/amend.
4) send all the info to my colleague.

if so has anyone seen a similar script that I could take a look @ to see if I can hack it to suit my needs?

Variable Extracted Out Of One Form Not There Anymore After Submitting Another Form
in short what I'm trying to do: pass a variable from a form that's posted
to a certain page, to the same page. The variable is extracted with
$_REQUEST. Next, another form in the same page is submitted, again to the
same page. Following that, I have code depending on the submission of the
latter form. In that code, I try to do something with the variable that
has been submitted with the first form, but it's not there anymore. I
tried passing it to another variable beforehand, making it a session
variable, making the $_REQUEST conditional, etc etc. But nomatter what I
do, it remains empty.

What's the correct way to go about this?

Integrate Client Form With Third Party Form
Anyway, here's the deal. The client wants a certain form to have its input send to a third party. The form is *only* an email address - that's it. Looks like this:

<?
if ($action == "sendmail"){
if ($error == "")
{ echo "<span class="error2"><b>Thank You!</b> &nbsp; You're now signed up for the Company Newsletter, the foremost authority on developing quality requirements specifications. Watch for it in your inbox!</span>"; }}
?>

<?php

if ($error == "1") {
echo "<span class="error2">";
}
if ($emailerror == "1")
{ echo "The e-mail you entered was invalid. Please check it and try again."; }
if ($error == "1")
{ echo "</span>"; }
?>

Sign up for our FREE newsletter on <b>developing quality requirements specifications.</b><br />

<form method="post"
name="newsletter"
action="<? echo $PHP_SELF?>">
<input type="hidden" name="recname" value="Company Name" />
<input type="hidden" name="subject" value="Newsletter Email Submission" />
<b <? if ($emailerror!= "")?> >Email:</b></span>
<input class="input" type="text" name="email" size="20" value="<? echo $email?>" />

<input type="hidden" name="action" value="sendmail" />
<input class="button" type="submit" value="Send It" />
</form>

See? Simple. One field. If the end user does not input an email address, or inputs an invalid string as an email address, it returns the error.

The PHP code is as such:
<?
isset($_POST['action'])? $action = $_POST['action'] : $action = ''
isset($_POST['email'])? $email = $_POST['email'] : $email = ''
if($action!="sendmail"){
include ("home.shtml");
exit;}
if ($action == "sendmail") {
if (!ereg('^[-!#$%&'*+./0-9=?A-Z^_`a-z{¦}~]+'
.'@'.'[-!#$%&'*+/0-9=?A-Z^_`a-z{¦}~]+.'
.'[-!#$%&'*+./0-9=?A-Z^_`a-z{¦}~]+$', $email) ¦¦ ereg("'", $email)) {
$emailerror = "1";
$send = "no";}
if ($send == "no") {
$error = "1";
include ("home.shtml");
exit;}
$to = "email@company.com";
$message = nl2br("Please add my e-mail to your newsletter mailing list.
e-Mail address: $email");
$mailheader = "From: <$email>
Content-Type: text/html";
mail($to, $subject, $message, $mailheader);
}
{
include ("home.shtml");
exit;
}
?>

More simplicity. Gotta love it.

Now I find out I need to make it work with this third party service. Unfortunately, the only code they provide is for HTML based foms *only*. (Yes, I actually called them on the phone to ask for assistance, and they basically told me to figure it out for myself, because they don't provide support for anything but generating HTML code. Nice.)

So, here's their code that somehow needs to be integrated into mine (I'm changing some stuff, because I don't know what it does - but I mean like the numbers they make me input for things - I don't know if they're client-specific or not):

<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8">
------------------->
<form action="3rdParyURL/servlet.WebToLead?encoding=UTF-8"
method="POST">

<!------------------
This HTML is defaulted to DEBUG mode so that your web master can test the online Web-to-Lead page from the desktop. Once your web master has finished testing please remember to remove the entire "debug" and debugEmail" lines of code prior to adding this HTML to
your website.
------------------->
<input type="hidden" name="debug" value=1>
<input type="hidden" name="debugEmail" value="me@myemail.com">
<input type=hidden name="oid" value="123456789065432">
<input type=hidden name="retURL" value="http://www.companysite.com">
Email: <input name="email" id="email" type="text" size=20 maxlength=80><br>
newsletter request: <input type="checkbox" name="56A987123J5489P"
value="1" id="752D58963G1247W"><br>
<input type="submit" name="submit">
</form>

Now, you will notice that they have a checkbox for adding someone to the newsletter - but the client just wants the sender sending the e-mail the only thing they need to do to get this going.

I have *no* clue how to integrate this into my PHP. I can only have the e-mail area, and I don't know what to do about the action - if I replace my <? echo $PHP_SELF?> with their action - it negates my page. not completely, though - but for the most part....

File Upload Limit Using Php Form, Can I Use FTP Somehow From Form?
My host has a 2MB limit on file uploads and can't change it but they do not
have a limit on ftp files uploads. Is there a way to use ftp from the form
to upload a file?


PHP Contact Form--blank Subject When Form Is Sent
I have a contact form, which has a subject field (the subject of the email that is sent to me), and when the form is submitted, the subject is not being sent.  Instead, I just get a blank subject. Code:

Getting Multipart Form To Move To The Next Form
Having trouble getting a multipart series of forms to move to the next form.
The problem line is:
<form method="post" enctype="multipart/form-data" action="Data_Form1.php">

If the "action" parameter is set to the current form (Data_Form1.php) then
the data posts to the table correctly, but it does not move to the next form
If the "action" parameter is set to the next form in the series then by
clicking "submit" it moves to the next form, but the data does not post to
the table.....

Pass Infomation Form One Form To Another
I created a post html page where the user fills out a form and it sends it to my PHP script using the $POST method.  I have validated froms checking for input if non is given it prints an error message.  Now here is my question how can I reload the form with the information that the vistor entered on the previous one.  My HTML code is stored in a varible $htmlcode here is the code for it is below.  This comes from the original html document that passed the value to PHP from the form.  I tried to set the values of the input text box to strings; however that did not work.

Here is what I used <input type="text" name="db_fax" value="$db_fax" size="25">.  For some reason the scipt didnt read the value of the string and put it as its value. It just filled the input text boxes with the name of the string($db_fax). To output the data is used print "$htmlcode"; method. If some one could tell me what Im doing that would be awesome. Code:

Getting A Form Value Without Submitting A Form
I have a complicated system I need to work around. One I don't care to explain too much, but essentially I would like to grab a form (I know how to do this) and then have php copy the value in a field to a variable. Is this possible?

Posting Form Data And Also Allow To Download Form Data
i have a client that whats to post form data to a database but he also wants users of the script to download it aswell how will i got about doing this i thought about it that i could make it save it into a txt file then echo the download link is there any ideas? because to post it to a txt file it would be posting 2 places is there a way to do this? Code:

Form To Fax
Can anyone please give me or tell me where I can get a script that will send form that is inputed into a form to a fax machine.

Form
I need to create a form that contains multiple lines for the same
data....an array looks like the answer.

My form:

Date Name Title Phone
====================================
_____ ________ _________ ________

My first though was to have variables:

date, name, title, phone, date1, name1, title1, date1,
date2,name2,title2,phone2,date3,name3,title3,date3

etc so that I can have 10 "lines" for the user to enter this data into.
Some will enter 1 line, others all 10.

So far, my clunky methods work....however trying to decide how many
lines they have filled out led me to thinking "perhaps I should use an
array instead".

This data is submitted to a database (mysql on linux) and I am not sure
if even that will work.

My question is HOW can I build a form that contains 4 fields that could
be repeated across numerous lines....then put it all into a db for
retrieval later?

Form To Txt
I would like to have data typed in a html form that when submitted the values are presented within a designed html page you know with graphics and all that. The basic intent is to have a form filled out and then allowing the user to print out the values on the following html page. I don't want the form data saved in a txt file or sent via email.

Not sure now if I should use cgi or php or what after the info I have read. Any help would be greatfull.

Web Form
Im doing this web form, but because its fairly long to go on 1 page I was wondering how I would go about doing it on multiple pages. The only way I can think of doing this, is by registering sessions after each page, and then calling all sessions and put them in the MySQL INSERT statement. (data from form needs to be entered into mysql database)

Getting The Form Id
If you set the id attribute of a form, how do you access the id's
value from the script handling the post submission?

Php $ GET From A Form
I am working on a system that logs IP addresses, I posted earlier about pagination, which I now have sorted however I am now attempting to implement a search feature that will display the results and also offer the pagination.

The paghination is working like this

mysite.com/logs.php?limit=10&page=1

I have introduced a new file called search.php that has the following URI, mysite.com/search.php?ip=192.168.0.1&limit=10&page=1

my problem is getting the IP address or value typed into the search text box (the search text box appears at the top of the search.php file), How do i get the value from the search text box into the URI, and also how do i make it so that once it is in a variable that variable will never change, even if the page is reloaded (session variables?) so I suppose its more of how do i get the search text into a session variable, and then get the session variable into the URI for the ip attribute?

any help here would be appreciated, if you need to see code snippets just ask, I didn't want to post the entire code as its long and also incase the solution didn't need it.

Form Value To DB
I've tried many many different approaches to this question, and have come up empty every single time... very irratating. This is the question: I'm creating an upload script, and would like the admin to be able to add extensions that he/she would allow user's to upload.

I created a form text field, and just want them to be able to simply add the extensions, with a comma seperating them... example: gif,jpg,jpeg,png,bmp

Then, the value gets stored into the sql DB, and is drawn from the upload script. Again, I've tried several things to get the array to work properly... the current one I have is this: I pull the $file_ext from the DB, and try to put it into an array like so...

$file_ext = array($file_ext);

Then, I have it the uploader check for file exensions, to see if they are allowed from the array:

if(!in_array(strtolower(substr($_FILES['file']['name'],-3)),$file_ext)) {

But it will disallow all entries, no matter what I do... I just want to be able to pull the info from the DB, and be able to check the extensions for permission to upload them...

Can someone help me with this problem? I've very stumped... or could anyone come up with a better method?? I would like to keep the original admin form field, where they can just add extensions sperated by commas, if possible. I just need to able to put those fields into a working array that I could use with the upload script. I've checked EVERYWHERE for some snippets, but have found nothing useful.

Pdf Form
Is there any possible to create a pdf file at runtime with textboxes
and checkboxes .
The output pdf form looks like a application form and the user can
fill the text box and check boxes and can printout the form.

look like

Name --------------------
Gender checkbox checkbox
address ------------------------------------

Get Form Name / Id ?
I have a form

<form name="jim" id="jim" .......... >
.........
</form>

How do I get either the name or id from the form in PHP ?

Form Within A Form
I've got a form that posts to another page that saves the changes made to a record. Is there a way that I can imbed another form in that form that posts the information to a different page that'll print it in a pdf file. Code:


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