Click to See Complete Forum and Search --> : FORM problem + other questions - help!


jericho
08-11-2003, 06:54 AM
I have a couple of problems, perhaps you could help me and post some helpful tips. Thanks


Problem 1. I use a html Form tag, which I use to get data from user and writing them in a database (using php) in MySQL. My Form tag looks like this:

<form action="poly_k.php" method=post>
<input type="text" name="polyvol" size="4" maxlength="4">
<input type="submit" value=" Buy ">
</form>

Everything up to this point works fine. File poly_k.php takes care of the writing into database actions.

Now, I'd like to use data which I enter into the window <input...> use in 2 ways, depanding which button I press. In other words, I'd like to have a "Buy" submit button and "Sell" submit button and they would both use data from one input window. How do I do that?

Is the following correct? (I suspect not...)

<form action="poly_k.php" method=post>
<form action="poly_s.php" method=post>
<input type="text" name="polyvol" size="4" maxlength="4">
<input type="submit" value=" Buy ">
<input type="submit" value=" Sell ">
</form>

How do I do that?


Problem 2. I use frames. Now, 'd like to click a link in one of the frames and I'd like it to modify the contents of the other frame, whichout changing the current frame. How do I do that?


Problem 3. I have a picture, which I use as a link (.jpg or .gif file). Now, I'd like this picture to have a couple of areas and depanding which area I click, I go to a different link (different URL). How do I do that? Do I have to use javascript for that?

If you can help me and post, please do.

Thanks,

Jericho

sciguyryan
08-11-2003, 06:59 AM
hi,


i think that this question should be in the forum "PHP" as they are the ones that specialise in php, mysql and things like that.

jericho
08-11-2003, 07:22 AM
OK, I will post in PHP thread, but Form tag is a html tag.

I'm really desperate and I can't figure it out. If someone has some friendly tips, please post and help. Thank you.

pyro
08-11-2003, 07:29 AM
#1: Guess I'll wait for your post in the PHP forums...

#2: Depends on what you need. Can you use a regular link to change it? <a href="someurl.htm" target="framename">link</a>?

#3: Read up on imagemaps: http://www.w3.org/TR/html4/struct/objects.html#h-13.6

jericho
08-11-2003, 07:46 AM
pyro - Thanks a lot! These things are frustrating and I'm trying to learn. Your help means a lot!

#2: Here is what I have. I have a main file and I have 3 frames on my page. There is a different file for each of the frame: fr01.php, fr02.php and fr03.php.

Now I have a link in fr01.php. I'd like this link to run another php file (this is easy) and then to refresh fr02.php in the other frame. How can I do that?

What I have now is when I click a link, it changes the contents of the current frame, not the other frame.

This is my main file:

<html>

<head>
<title>main01</title>
</head>

<frameset cols="21%,79%">

<frame src="fr01.php">

<frameset rows="14%,86%">

<frame src="fr011.php">
<frame src="fr02.php">

</frameset>

</frameset>

</html>

-----------------

<a href="someurl.html" target="framename">blah blah</a>

What do I use as target="framename"? Shall I use target="fr02.php"?

pyro
08-11-2003, 08:19 AM
No, you need to give each of your frames names, and then use that in the target.

jericho
08-11-2003, 08:23 AM
Is the following correct?


<html>

<head>
<title>main01</title>
</head>

<frameset cols="21%,79%">

<frame name="fr1"src="fr01.php">

<frameset rows="14%,86%">

<frame name="fr2" src="fr011.php">
<frame name="fr3" src="fr02.php">

</frameset>

</frameset>

</html>

pyro
08-11-2003, 08:29 AM
Yes, though in your first frame, put a space between name="fr1" and src="fr01.php"

jericho
08-11-2003, 09:15 AM
Thanks. This should work well, I will try that in a second.

jericho
08-11-2003, 09:46 AM
Works great! Thanks!

But another thing... let's say that now I want a link from one of the frames to effect the entire page, not only a selected frame. How do I do that?

pyro
08-11-2003, 10:40 AM
Use target="_top".

jericho
08-12-2003, 03:05 AM
Thanks. Also target="_parent" seems to work fine.

pyro
08-12-2003, 08:35 AM
Yes, they are close to the same, but target="_top" will work for nested framesets, as well...