[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 08-07-2005, 02:33 PM   #1 (permalink)
NamePros Regular
 
Join Date: Aug 2005
Location: Leeds, UK
Posts: 260
70.00 NP$ (Donate)

noswad is an unknown quantity at this point


Web forms - please help me

Hello. Im new to web design and have a little problem ....

I have described the problem here if you would please take a look.

www.Offer-Zone.co.uk

Thanks guys.

Its driving me mad. I have tried and edited loads of forms with no luck.
noswad is offline  
Old 08-07-2005, 04:12 PM   #2 (permalink)
DNOA Member
 
mholt's Avatar
 
Join Date: May 2004
Location: Utah
Posts: 5,041
18.01 NP$ (Donate)

mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future

Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
What does the = sign do? O.o If you meant to pass a variable via the URL bar, then you need ?= instead.

Be sure you set a form action. PHP can accomplish your needs easily ... just set the form action to be, say, "go.php", make sure that the number is > 0 (so you know they actually entered one) then put in that header() function BEFORE you send ANY data to the browser.

As for opening in a new window then, um, not sure... maybe Javascrict can fulfil your needs, unless a form tag has a target attribute.

PHP Code:
header ("Location: http://www.amazon.com=".$number);
If you can't use PHP (dunno why not though), I'm not sure how to do it through just HTML. In fact, I don't think it's possible...
__________________
codeboards

A high-quality community of programmers -- Join today and post! We want new members!
mholt is offline  
Old 08-07-2005, 05:31 PM   #3 (permalink)
Account Closed
 
Sergio965's Avatar
 
Join Date: Apr 2004
Location: ~root
Posts: 1,095
1,505.80 NP$ (Donate)

Sergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to behold


Ah, I remember modyfying a google PR tool to do something like that.

Let's see if I can remember it, will edit.

Ok so, I know how to do it, but it has to have a name, it can't just be:
http://amazon.com=265123. It could be http://amazon.com/?ref=542134 or something like: http://amazon.com/?id=25634

Etc. So, yea. :P

Last edited by sergio965; 08-07-2005 at 06:04 PM.
Sergio965 is offline  
Old 08-07-2005, 11:17 PM   #4 (permalink)
NamePros Member
 
Join Date: Jan 2005
Location: Texas USA
Posts: 71
203.00 NP$ (Donate)

Outer is an unknown quantity at this point


Maybe your form tags are incorrect?

basically, when a form is submitted, check if that field has been entered, check if its a number, then do as stated above, use the header function to redirect the user to the appropriate link

as for not seeing the amazon.com link, you could use one entire frame thats 100% by 100% :-/
__________________
I wonder...
Outer is offline  
Old 08-08-2005, 04:36 AM   #5 (permalink)
NamePros Regular
 
Join Date: Aug 2005
Location: Leeds, UK
Posts: 260
70.00 NP$ (Donate)

noswad is an unknown quantity at this point


Hi sergio, http://amazon.com/?id=25634 is perfect.

Is there any code you could possibly post for me please?

Thanks for your help guys.
noswad is offline  
Old 08-08-2005, 06:28 AM   #6 (permalink)
DNOA Member
 
mholt's Avatar
 
Join Date: May 2004
Location: Utah
Posts: 5,041
18.01 NP$ (Donate)

mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future

Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Here... you won't have to show the amazon.com at all in the textbox. It's quite simple. Set your form action to "go.php" or whatever you name this PHP file, and method should be POST.

Here's some code:

go.php
PHP Code:
<?php

//Replace the value in [' '] to be the name of the textbox you declared in the form file.
$number = $_POST['number'];

//Empty?
if ($number < 1)
{
    echo
'You have to type a number!';
    exit;
}
//Not a number?
if (!is_numeric($number))
{
   echo
'You must type a NUMBER.';
   exit;
}

//Put some code here to verify if you need the number to be between a certain amount.
//If you don't want decimals, you may want to check for those too.

//Redirect the user now.
header ('Location: http://amazon.com?id='.$number);

//Done!
?>
Not exactly sure if "is_numeric" has the underscore, but I think it does. Tell me if it works.
__________________
codeboards

A high-quality community of programmers -- Join today and post! We want new members!
mholt is offline  
Old 08-08-2005, 12:17 PM   #7 (permalink)
Account Closed
 
Sergio965's Avatar
 
Join Date: Apr 2004
Location: ~root
Posts: 1,095
1,505.80 NP$ (Donate)

Sergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to behold


Quote:
Originally Posted by noswad
Hi sergio, http://amazon.com/?id=25634 is perfect.

Is there any code you could possibly post for me please?

Thanks for your help guys.
Yea, Hold on:

Code:
<form name="input" action="http://www.amazon.com" method="get">
<input type="text" name="id">
<input type="submit" value="Submit">
</form>
Simple as that (Reputation would be nice :P)

Sergio965 is offline  
Old 08-08-2005, 12:32 PM   #8 (permalink)
DNOA Member
 
mholt's Avatar
 
Join Date: May 2004
Location: Utah
Posts: 5,041
18.01 NP$ (Donate)

mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future

Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
... or you could do that <_<...
__________________
codeboards

A high-quality community of programmers -- Join today and post! We want new members!
mholt is offline  
Old 08-08-2005, 07:34 PM   #9 (permalink)
Account Closed
 
Sergio965's Avatar
 
Join Date: Apr 2004
Location: ~root
Posts: 1,095
1,505.80 NP$ (Donate)

Sergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to behold


Quote:
Originally Posted by compuXP
... or you could do that <_<...
Sergio965 is offline  
Closed Thread


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

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
7 Web Site Design Mistakes That Will Lose You Clients vimkar Webmaster Tutorials 39 04-20-2006 08:42 AM
Chapter 23 Web Marketing Integration WebForging Webmaster Tutorials 0 03-20-2005 08:00 PM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 06:45 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85