On 05/05/2011 08:31, Geospectrum wrote:
> 
> I am putting together a simple website and would like visitors to be
> able to type a number into a form (say 1234) and a perl script should
> run open an existing page called .../1234.html  or generate an error
> page if the use enters a wrong number.  I will have already uploaded
> the page before a user enters the number so the per script can open it
> rather than generate a  new one (unless it can be generated on the fly
> which may be better?)
> 
> I think this should be able to be done but I have no idea how. for
> instance how do i append the '.html' to the file name.
> 
> The website is here (www.ashcraftframing.co.uk) . The fom is in the
> bottom right of the page and launches a invopice page for PayPal.   I
> want users to enter a invoice number corresponding to a page I have
> already up loaded.
> 
> If anyone know of some pre existing code I can modify I'd be very
> grateful.  I have only done a little 'cook book' scripting so please
> go easy on me!

An onClick attribute to your button will do the trick. Just something
like this

  <input type="button" name="go" id="go" value="Go" 
onClick="window.location=form1.url.value+'.html'" />

will do what you describe, but you will need to write more to validate
the input before trying to display the invoice.

It is probably also possible to generate the invoice on the fly. How
difficult that might be depends on the format you want to see.

HTH,

Rob

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to