• 0

Need Some Help with form action in HTML Code


Question

Hello!

I'm doing some homework for my university and I would like my homework to be accessed remotely as well.

I have already port formwarded and I can access my webpage but when I press submit from a Remote IP my webpage does not work correctly because there's a mistake in the form action code line and I do not know how to correct that.

 

Here's the HTML code

 

 I want to correct the form action line in order for my webpage to work correctly from other clients as well

<!-- A form for selection a of a continent. Selection to be sent by POST -->
<HTML>
<HEAD>
   <TITLE>Cookie will be written in our disc</TITLE> 
</HEAD>
<BODY>
<FORM ACTION="http://localhost:8080/myExamplesDir/firstCookieDemo"
                                                                                                                         METHOD="POST">      
      <STRONG>Select the Continent of your Destination:<br> </STRONG>
      <PRE>
      <INPUT TYPE="radio" NAME="continent" VALUE="Europe">check here for Europe<BR>
      <INPUT TYPE="radio" NAME="continent" VALUE="Asia">check here for Asia<BR>
 <INPUT TYPE="radio" NAME="continent" VALUE="America" CHECKED>check here for America<BR>
      <INPUT TYPE="radio" NAME="continent"  VALUE="Africa">check here for Africa<BR>
      </PRE>
      <INPUT TYPE="submit" VALUE="Submit">
      <INPUT TYPE="reset"> </P>
   </FORM>
</BODY>
 
</HTML>

post-174060-0-09778000-1399732886.png

post-174060-0-34811800-1399732888.png

post-174060-0-66110800-1399732890.png

9 answers to this question

Recommended Posts

  • 0
  On 10/05/2014 at 14:50, MariosX said:

Is there any way to correct that?

 

If you want it online so that it can be accessed by anyone you will need to setup a web server. There are much quicker solutions such as: http://bowery.io which sets up a dev environment in 30 seconds and gives u a web accessible URL... if you are not experienced with servers and web dev stuff you will need to read up on the docs... or better yet a few dollars for a host account and host it online.

  • 0

If I change my

<FORM ACTION="http://localhost:8080/myExamplesDir/firstCookieDemo">

to

< <FORM ACTION="http://myhostname.com:8080/myExamplesDir/firstCookieDemo"

 

It will work but it won't work on my hostname

  • 0

Setup your router and apache server config to make your localhost a public ip server.

 

So first make sure you're using port 80 instead of 8080 then test if you can connect with another device on the same wifi network to your computer ip"*

Then forward your pc ip to your public ip**

 

 

 

*192.168.1."something" in most cases

**63.233.34.12 looks like this

 

 

If you got a hostname(example.com) make sure to point it to your pc ip address, this can be done with a A record.

  • 0
<form action="/myExamplesDir/firstCookieDemo"  method="POST">

That should do it. Starting a URL with / makes it relative to the current host root.

 

And please use lowercase HTML elements, it looks much better and is a convention. If you start using developer tools you'll notice everything is lowercase too, even if you write it uppercase in your HTML.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Rustdesk. https://rustdesk.com/ You can even set up your own relay server (if you desire).
    • ICYMI: 4TB Corsair MP700 PRO SE SSD is still selling at its lowest price by Fiza Ali Amazon US and Newegg are still offering the 4TB Corsair MP700 PRO SE solid-state drive at its new lowest price. The MP700 PRO SE is an M.2 2280 SSD that employs a PCIe 5.0 ×4 interface with NVMe 2.0, delivering sequential read speeds of up to 14,000MB/s and sequential write speeds of up to 12,000MB/s. It uses high-density 3D TLC NAND and carries a Total Bytes Written (TBW) rating of 3000. Furthermore, the drive can withstand vibration from 20Hz to 80Hz at 1.52mm and 80Hz to 2000Hz at 20G, as well as shocks up to 1500G. The drive incorporates AES 256-bit encryption and supports Microsoft DirectStorage, allowing compatible games to load assets directly to the GPU for reduced load times. Moreover, it operates within a temperature range of 0°C to +70°C, and can be stored between –40°C and +85°C at up to 93% relative humidity (40 °C). A heatsink is not included, so users must provide their own or rely on a motherboard’s integrated SSD cooling solution to maintain optimal thermals. Finally, the MP700 PRO SE is compatible with Windows 10, Windows 11, and macOS systems that provide an M.2 slot, and communicates via a standard M.2 2280 interface connector. 4TB Corsair MP700 PRO SE SSD: $549.99 (Amazon US) 12% off - $549.99 (Newegg) 9% off This Amazon deal is US-specific and not available in other regions unless specified. If you don't like it or want to look at more options, check out the Amazon US deals page here. Get Prime (SNAP), Prime Video, Audible Plus or Kindle / Music Unlimited. Free for 30 days. You can also check out other SSD deals here. For hard disk drives, you can head over to our HDD deals section to see if anything from there matches your requirements. Make sure you also browse through Amazon US, Amazon UK, and Newegg US to find some other great tech deals. As an Amazon Associate, we earn from qualifying purchases.
    • "requiring individual licences from all rights-holders would impose an unmanageable administrative burden and could deter AI investment in the UK." Ah so plebs (humans) will forever be required to secure license, but AI should get a broad pass because it's too complicated. Not so "intelligent" after all? Plus, every opt out I have signed regarding Meta using my data was never presented to me in a clear way, I had to discover it here on neowin or some other news site with a link to do it. So what the government is saying is that they prefer to offer an opt out just to cover their asses, but good luck us plebs finding such a thing!
    • The look speaks volumes, doesn't it?  
  • Recent Achievements

    • First Post
      ClarkB earned a badge
      First Post
    • Week One Done
      Epaminombas earned a badge
      Week One Done
    • Week One Done
      Prestige Podiatry Care earned a badge
      Week One Done
    • Week One Done
      rollconults earned a badge
      Week One Done
    • Week One Done
      lilred1938 earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      136
    2. 2
      Xenon
      129
    3. 3
      ATLien_0
      123
    4. 4
      +Edouard
      102
    5. 5
      snowy owl
      96
  • Tell a friend

    Love Neowin? Tell a friend!