Return to iWEBTOOL

Go Back   iWEBTOOL Talk > The Web and your Website > Programming > PHP
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 
Welcome to iWEBTOOL Talk, where you talk about webmaster-related stuff.
 
Discuss topics which interest you.
With over thousands of threads (topics), we're sure you'll find something that'll interest you.
Ask for help whenever you need it.
We have thousands of members who are available to help you if you need it.
It's absolutely FREE!

 1  Register           2  Browse the board           3  Discuss whatever may interest you!
 


Reply
 
Thread Tools Search this Thread Display Modes
Old 01-13-2008, 12:27 PM   #1
prabhatkr
Smurf
 
prabhatkr's Avatar
 
Join Date: Jan 2008
Posts: 1
prabhatkr is on a distinguished road
Default form not working..plz help!

Hi,

I was trying to make a single text input form . Index.php would take a search query and pass it to welcome.php.
The code of two files are as follows:INDEX.PHP
<body><div>
<form action="welcome.php">
!nfo&nbsp;<input type="text" size="80" maxlength="200" name="query"><br />
<input style="margin-top:15px; padding:5px 12px 5px 12px" type="submit" value="submit" name="submit">
<input type="hidden" name="_submit_check" value="1"/>
</form></div></body>
WELCOME.PHP

<form action="welcome.php">
<input type="hidden" name="_submit_check" value="1"/>
!nfo<input type="text" size="80" maxlength="2048" name="query"><br />
<input type="submit" value="submit" name="Spreaz" class="relay">
</form>
<?php
$query = $_REQUEST["query"];
if (array_key_exists('_submit_check', $_REQUEST)) {
/* ... do something with the form parameters ... */
}
if (!isset($_REQUEST['submit'])) { // if page is not submitted to itself echo the form
?>
<?php
} else {
echo "Finding Query &nbsp; ".htmlentities($_REQUEST['query']);
} ?>
Now the first Issue is with Index.php. When I enter a query and press enter Key , it goes to the welcome.php page but without any query only in MSIE. It works with mouse click.
Secondly when I enter a query in welcome.php, it doesn't return any results(doesn't prints the message of query."Finding Query"), neither in FF or MSIE.

Please help.
prabhatkr is offline   Reply With Quote
 
This is an Ad Revenue Sharing forum Place your advert here
SEO Checklist
Get yourself better ranking with
our "Do-it-Yourself" SEO Checklist.
Click Here
Old 01-13-2008, 12:42 PM   #2
Mega B
Member
 
Mega B's Avatar
 
Join Date: Oct 2007
Location: London UK
Posts: 144
Mega B will become famous soon enough
Default Re: form not working..plz help!

I guess a small introduction would have been nice 1st before asking for some help
__________________
Too many signature links ... oh dear!
Mega B is offline   Reply With Quote
Old 01-13-2008, 04:08 PM   #3
UnKnown
Moderator
 
UnKnown's Avatar
 
Join Date: Aug 2006
Posts: 1,134
UnKnown is just really niceUnKnown is just really niceUnKnown is just really niceUnKnown is just really niceUnKnown is just really nice
Default Re: form not working..plz help!

why do you have the form twice?
your form is missing a critical parameter "METHED" i suggest methed "POST"
Hides data
$_REQUEST is an ambiguous PHP super array use $_post and $_Get where needed

also you don't need to evaluate for submit being set
UnKnown is offline   Reply With Quote
Old 01-20-2008, 12:12 PM   #4
imrankhan
Member
 
imrankhan's Avatar
 
Join Date: Aug 2006
Posts: 198
imrankhan will become famous soon enough
Default Re: form not working..plz help!

<body><div>
<form action="welcome.php" method="post">
!nfo&nbsp;<input type="text" size="80" maxlength="200" name="query"><br />
<input style="margin-top:15px; padding:5px 12px 5px 12px" type="submit" value="submit" name="submit">
<input type="hidden" name="_submit_check" value="1"/>
</form></div></body>


In above i have added method=post

On second page (welcome.php) use this on the top

$query=$_POST['query'];

then you can check if this value is coming by just typing

echo $query; //this will print the result.
__________________
Houses for Sale - Cars for Sale
imrankhan is offline   Reply With Quote
Old 01-20-2008, 04:13 PM   #5
UnKnown
Moderator
 
UnKnown's Avatar
 
Join Date: Aug 2006
Posts: 1,134
UnKnown is just really niceUnKnown is just really niceUnKnown is just really niceUnKnown is just really niceUnKnown is just really nice
Default Re: form not working..plz help!

Quote:
Originally Posted by imrankhan View Post
<body><div>
<form action="welcome.php" method="post">
!nfo&nbsp;<input type="text" size="80" maxlength="200" name="query"><br />
<input style="margin-top:15px; padding:5px 12px 5px 12px" type="submit" value="submit" name="submit">
<input type="hidden" name="_submit_check" value="1"/>
</form></div></body>


In above i have added method=post

On second page (welcome.php) use this on the top

$query=$_POST['query'];

then you can check if this value is coming by just typing

echo $query; //this will print the result.

Your Welcome
Perfect example on why the forum help has decreased
A simple Ty for your time makes it seem worth while to post

nevermind im an idiot i thought you was the original poster
UnKnown is offline   Reply With Quote
 
This is an Ad Revenue Sharing forum Place your advert here
Webmaster Tools Webmaster Tools Click Here
Reply



Quick Reply
Message:

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
plz plz plz review. nskyline Website Reviews 4 11-07-2007 12:27 PM
Plz rate it fawad Advertise your website 0 04-04-2007 09:59 AM
Plz Help me Fletcher Search Engine Optimization (SEO) 8 01-11-2007 12:43 PM
Opinions plz., kittyluver Website Reviews 1 09-06-2006 04:13 PM
Plz read this careerbharat Google 4 08-15-2006 01:12 AM


All times are GMT. The time now is 08:05 PM.


Powered by vBulletin v3.6.7 © 2008, Jelsoft Enterprises Ltd. SEO by vBSEO © 2006, Crawlability, Inc.