Jump to content

Form not working...


Seaholme

Recommended Posts

Hey there,

 

Basically I'm having some difficulty getting this form to work:

 

<form action=getitem.php method=post name=form2><input type=hidden name=itemid value='1'>
<input type=image src=items/ricketyoldsledge.png name=free class=img></form>

 

It'll work if it's at the top of the code for the page I want it on, however I want it to be in a later position (I've included the PHP for the whole page below, so hopefully you can see what I mean).

 

The error I get is that the form appears to send, only instead of sending me to getitem.php it just goes back to sledmakers.php.

 

 

<?php

include('connect.php');

include('header.php');
include('loggedin.php');

echo 'blah blah"';

// Check profession
      $result = mysql_query("SELECT * FROM players
              WHERE id=".$_SESSION['id']) or die(mysql_error()); 

while($row = mysql_fetch_array( $result )) {
$profession = $row['profession'];
$level = $row['level'];}


// if they're unemployed still

if($profession == 'Unemployed'){ 

	echo '<br><br><form action=sledmakers.php?talk=yes method=post name=form1>
<input type=submit name=submit value="Talk to the man?"><bR><Br>';

	 }

// if they're a Sledmaker

elseif($profession == 'Sledmaker'){
	echo 'Sledmaker';}

// if they're not a Sledmaker

else{

	echo 'What? You\'re not a Sledmaker! Go away.';}

	$talk = $_GET['talk'];

// if they're unemployed and pressed to speak with her

if($talk == 'yes')
{ echo 'blahblah';

echo 'You look in the corner and find what you\'re looking for...<bR><br>';
?>

<form action=getitem.php method=post name=form2><input type=hidden name=itemid value='1'><input type=image src=items/ricketyoldsledge.png name=free class=img></form>

<br><br><form action=sledmakers.php method=post name=form3>
<input type=submit name=submit2 value="Become the Master Sledmakers's Apprentice?"><bR><Br>

<?php

} else{ echo '';}

if(isset($_POST['submit2'])){
	echo 'You are now an Apprentice Sledmaker!';

	}

include('footer.php');
?>

 

Can anybody help me out? :/

If you need more info, please just ask!

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.