NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Web forms - please help me

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

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 08-07-2005, 03:33 PM THREAD STARTER               #1 (permalink)
NamePros Regular
Join Date: Aug 2005
Location: Leeds, UK
Posts: 263
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, 05:12 PM   #2 (permalink)
DNOA Member
Join Date: May 2004
Posts: 5,040
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); 
????: NamePros.com http://www.namepros.com/programming/113499-web-forms-please-help-me.html
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...
mholt is offline  
Old 08-07-2005, 06:31 PM   #3 (permalink)
Account Closed
 
Sergio965's Avatar
Join Date: Apr 2004
Location: ~root
Posts: 1,091
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.
Last edited by sergio965; 08-07-2005 at 07:04 PM.
Sergio965 is offline  
Old 08-08-2005, 12:17 AM   #4 (permalink)
NamePros Member
Join Date: Jan 2005
Location: Texas USA
Posts: 71
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, 05:36 AM THREAD STARTER               #5 (permalink)
NamePros Regular
Join Date: Aug 2005
Location: Leeds, UK
Posts: 263
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, 07:28 AM   #6 (permalink)
DNOA Member
Join Date: May 2004
Posts: 5,040
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'];
????: NamePros.com http://www.namepros.com/showthread.php?t=113499

//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.
mholt is offline  
Old 08-08-2005, 01:17 PM   #7 (permalink)
Account Closed
 
Sergio965's Avatar
Join Date: Apr 2004
Location: ~root
Posts: 1,091
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
 



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 )
????: NamePros.com http://www.namepros.com/showthread.php?t=113499

Sergio965 is offline  
Old 08-08-2005, 01:32 PM   #8 (permalink)
DNOA Member
Join Date: May 2004
Posts: 5,040
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 <_<...
mholt is offline  
Old 08-08-2005, 08:34 PM   #9 (permalink)
Account Closed
 
Sergio965's Avatar
Join Date: Apr 2004
Location: ~root
Posts: 1,091
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
 



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


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 09:42 AM
Chapter 23 Web Marketing Integration WebForging Webmaster Tutorials 0 03-20-2005 09:00 PM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 01:14 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger