Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > PHP > problem with a form

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-19-02, 02:32
abdul_a abdul_a is offline
Registered User
 
Join Date: Feb 2002
Posts: 5
Exclamation problem with a form

Hi,

I have a problem with a form.

I am not a programmer, but I didn't find what I need,
So I programmed a script about reading articles using PHP & MYSQL

First the guest choose the cat and then the author, so the action will be :

Show.php?action=showcat&catid=$catid&author= $authorid

After that he can choose the page and the section :

==
View page {} and section {} (do)
==
How can I submit (page) and (section) var into the URL like this :

Show.php?action=showcat&catid=$catid&author= $authorid&page=$page&section=$section


I used (method=\"POST\") and it works but it didn't view the (page) and (section) var in the URL above:

Show.php?action=showcat&catid=$catid&author= $authorid

The script will print $page and $section successfully and view the article with the page and section number.

When I used (method=\"GET\") it didn't work with me,
I tried to test it in a simple code

<?
echo "page : $page<br> section : $section";
echo "
<form name=\"form\" method=\"GET\" action=\"show.php\">
<font face=\"Tahoma\" size=\"5\">view page</font>
<input type=\"text\" name=\"page\" size=\"5\">
<font face=\" Tahoma \" size5\">and section</font>
<input type=\"text\" name=\"section\" size=\"5\">
<input type=\"submit\" name=\"Submit\" value=\"do\">
</form>

?>

this will delete the last URL (Show.php?action=showcat&catid=$catid&author= $authorid)
the cat and author info is disabled.

The Url will be :

show.php?page=1&section=2&Submit=do

now the (Submit=do) appears!

Is there a way to grab the page and section var into the URL like this:
Show.php?action=showcat&catid=$catid&author= $authorid&page=$page&section=$section
__________________
search for the truth....
Reply With Quote
  #2 (permalink)  
Old 05-03-02, 05:24
danny danny is offline
Registered User
 
Join Date: May 2002
Posts: 7
hi,

I think you need to put the parameter $page and $section in the action tag, like this:

<?

echo "page : $page<br> section : $section";

echo "
<form name=\"form\" method=\"GET\" action=\"show.php?page=$page&$section=$section\">
<font face=\"Tahoma\" size=\"5\">view page</font>
<input type=\"text\" name=\"page\" size=\"5\">
<font face=\" Tahoma \" size5\">and section</font>
<input type=\"text\" name=\"section\" size=\"5\">
<input type=\"submit\" name=\"Submit\" value=\"do\">
</form>
";

?>
Reply With Quote
Reply


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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On