Hi all,

Im doing my myspace profile and im using submit buttons in a form and the form action as the url for the page that the user gets taken to, however my external links dont work, and i also want them to be opened in a new window. How can i do this?

This is the current code for a link to my website:

<form id="form2" name="form2" method="post" action="[URL]">
 
<input type="submit" name="Submit2" value=".:Grafax:." style="width: 80px" />
 
</form>

The link dosnt work, it comes up with an "internal server error" but is ok wen i try typing in the url, and i also need it to come in a new window but i cannot use javascript! just CSS and HTML!!

Thanks every1!!

Max

Dani AI

Generated

MDGM's snippet is triggering that server error because the form is being used as a navigation tool while the action attribute contains extra markup (the profile editor often injects BBCode/anchor tags). As and pointed out, POST is for sending data to a server and is not needed just to take someone to a URL. Two simple, HTML-only solutions follow.

Use a plain anchor styled like a button (simplest and most reliable). The anchor should contain only the URL, and include target="_blank" plus rel="noopener noreferrer" for security:

<a href="http://www.grafax.co.uk" target="_blank" rel="noopener noreferrer" class="btn">.:Grafax:.</a>

.btn { display:inline-block; padding:4px 8px; background:#eee; border:1px solid #999; text-decoration:none; color:#000; }

If a real form is required (e.g., for tracking), make sure action is a plain URL and use GET (or omit method) with target="_blank" so the result opens in a new window:

<form action="http://www.grafax.co.uk" method="get" target="_blank">
  <input type="submit" value=".:Grafax:." />
</form>

Troubleshooting tips: view the generated HTML (editor "HTML" or browser "view-source") to confirm the action attribute contains only the clean URL (no [URL] tags or nested <a>). If the external site still returns an error on a POST, switch to GET or use a direct anchor link. Reference: HTML form and anchor attribute docs at MDN for form and target (see HTML form element and anchor target attribute).

Recommended Answers

All 3 Replies

i am fairly new to this but i'll give it a go so corrections would be appriciated.

i think the problem is the fact that you are using attributes that you do not need

id/name inless somthing is going to call this (unlikely/wasteful on MySpace) you should remove this.

but the main problem is the method attribute...you are posting sumthing this is ent to the server but there is no information held within the form. THIS IS WHY YOU ARE GETTING THE ERROR!!

so simply remove the method attribute and you are done. the form name attribute will not be nessasary. better to remove it (the removing of the name/id attribute will not affect anithing...its just not needed...if it is then of course leave it).

hope that was useful.

method=post means you want to write new data to a file. You have no file open, and you do not intend to write to a file.

<div id="profile_mp3Player" style="width: auto; height:auto;">
<object id="shell" name="shell" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="450" height="345" align="middle">
<param name="movie" value="" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<param name="allowscriptaccess" value="always" />
<param name="flashvars" value="uid=408310422&pcc=en-US&cc=en-US&el=http%3a%2f%2fwww.myspace.com%2findex.cfm%3ffuseaction%3duser.viewProfile%26vanity%3dfayrothedon%26&pertid=6ed84a5ddc8f9d580000000000000000&pguid=9965dbb86a224e1fbb05e1465e10bd33&hash=MIG%252bBgkrBgEEAYI3WAOggbAwga0GCisGAQQBgjdYAwGggZ4wgZsCAwIAAQICZgMCAgDABAjietA3NBIPwgQQ596te5Uq5dAr4bxdukV4CARwuSrwctMIcVT1dbTzMRpYh5BQEjpiFXer0ny77VyD4nwq4AV%252fo7HuoWgpfzcHdEwcOJc%252fEK%252fRxKz17tzkdFgFPEciFMHtl0X%252fKgDn6cCkgzJIjJ5Latca4%252fpep1hidfxRtanutsAe9DsmNA5R4JfTlQ%253d%253d&skinid=16&skin=http%3a%2f%%2fvideos%2fartist.xml&isus=true&on=1&afsongs=4&ayt=15&c1=0x000000&c2=0x00ADEE&c3=0x363636&c4=0x00ADEE&cip=&sip=&ili=true&proftype=7&pfc=UserViewProfile&plid=14571&profid=408310422&ptype=4&artid=9600445&pmix=False&shuffle=False&ap=0&fast=5&fatt=0&fadd=0&fapf=False&rast=5&ratt=0&radd=0&rapf=False&bast=-1&batt=-1&badd=-1&bapf=False&aytast=-1&aytatt=-1&aytadd=-1&xad=1&yad=1&zad=1&xadoff=-1&yadoff=-1&zadoff=-1&v=&novidslider=0&ar=110&g=Female&pertid64=6385418023301994606&showaa=true&showmm2=False&t=1&mt=audio&logerr=0&facp=0&racp=0&bacp=0" />
<!--[if !IE]>-->

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.