Jump to content

Submit button keeps returning wrong URL ?!?!?


ChrisMartino

Recommended Posts

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Your website name | Homepage</title>

<!-- This template was created by Mantis-a [http://www.mantisa.cz/]. For more templates visit Free website templates [http://www.mantisatemplates.com/]. -->

<meta name="Description" content="..." />
<meta name="Keywords" content="..." />
<meta name="robots" content="all,follow" />
<meta name="author" content="..." />

<!-- Javascript -->
<meta http-equiv="Content-Script-Type" content="text/javascript" />

<!-- CSS -->
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen, projection, tv" />
<link rel="stylesheet" href="css/style-print.css" type="text/css" media="print" />

<!-- Favicon -->
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
</head>

<body>
<div id="wrapper">

	<!-- Header -->
	<div id="header">

		<div id="header-arrow"></div>
	</div>
	<!-- Header end -->

	<!-- Menu -->
	<a href="#skip-menu" class="hidden">Skip menu</a>
	<ul id="menu" class="cleaning-box">
		<li><a href="index.php" class="active">Home</a></li>
		<li class="first"><a href="image.php">Create a Image</a></li>
		<li><a href="maps.php">Map Converter</a></li>
		<li><a href="firstsamp.php">First SA-MP Server</a></li>
		<li><a href="contact.php">Contact</a></li>
	</ul>
	<!-- Menu end -->

<hr class="noscreen" />

<div id="content-box">
	<div id="content-box-in">

		<a name="skip-menu"></a>
		<!-- Content left -->
		<div class="content-box-left">
			<div class="content-box-left-in">
			<?php
			  if($_GET['online'] == "")
			  {
				?>
				<h3>Create a Image</h3>
				<p class="text-content">
				<form action="image.php?online=true" method="get">
					IP: <input type="text" name="ip" />
					Port: <input type="text" name="port" />
					<input type="submit" />
				</form> 
				</p>
				<div class="gallery">

				</div>
			<?php
			   }
                                   elseif($_GET[online] == "true")
                                   {
                                   	$ServerImage = "sig.php?$_GET[ip]&port=$_GET[port]";
                                        echo' <h3> Your image : </h3>';
                                        echo'<img src="$ServerImage" />';

                                   }                               
	                  			
			?>
			</div>
		</div>
		<!-- Content left end -->

<hr class="noscreen" />

		<!-- Content right -->
		<div class="content-box-right">
			<h4>News</h4>
			<div class="content-box-right-in">
				<dl>
					<dt>Website Created</dt>
						<dd>We have got the website up and running!.</dd>

					<dt>Map Converter</dt>
						<dd>Map converter coming soon!.</dd>
				</dl>
			</div>
		<div id="column-right-bottom"> </div>
		</div>
		<!-- Content right end -->
		<div class="cleaner"> </div>
	</div>
</div>

<hr class="noscreen" />

<!-- Footer -->
<div id="footer">
	<p class="left">© <a class="b" href="#">SA-MP SigZ</a> 2010</p>
</div>
<!-- Footer end -->
</div>
</body>
</html>

 

 

It's supposed to goto image.php?online=true when you hit submut but instead, It dose image.php?ip=SomeIpHere&port=SomePortHere ?, I'm stumped can anyone help?

Link to comment
Share on other sites

Your form method is 'get'. That causes any form data to be appended to the end of the URL being requested, thereby replacing any get parameter you put on the end of the URL.

 

You would need to use a hidden form field to set online=true as part of the URL or you would need to use the post method.

Link to comment
Share on other sites

make it so you can't replace whats in it

Anything put into a form can be altered. The only sure way to prevent something from being altered or replaced is to not put it into the hands of the visitor.

 

If you want to display a value, go ahead, but keep and use the actual value on the server only.

Link to comment
Share on other sites

this is the code

[code=php:0]
			<?php
			   }
                                   elseif($_GET[image] == "create")
                                   {
                                   	$ServerImage = "sig.php?ip=$_POST[ip]&port=$_POST[port]";
                                   	$BBCode = "[img=sig.php?ip=$_POST[ip]&port=$_POST[port]]";
                                        echo' <h3> Your image : </h3>';
                                        echo $BBCode;
                                   ?>
                                   
                                        <img src="<?=$ServerImage?>" />
                                        <br>

                                        Forum Code:     <input type="text" value"<?php echo $BBCode; ?>" /> (Used for embeding in forums)
                                <?php

                                   }                               
	                  			
			?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.