Decks
Cards
Store
IN USA!
Forum
Help
Welcome to MTG Vault!
Register
Login
Discussion Forum
Forum Home
MTG General Discussion
Help with MTG webpage
For a school IPT assignment, we have to make browser based game using our incredibly small knowledge or html and php, with CSS soon to be added. Always the egotist, i decided to do a MTG game, 1v1 hotseat. Each player enters a username, then selects a deck. The decks are selected on separate pages, and this is where i need help. When i click submit on the first deck select, the second deck select will not load. I have no idea why. could someone please have a look at my code and tell me where I went wrong (aside from wanting to do a hotseat MTG game.)
First deck select:
$name1= $_POST[name1];
$name2= $_POST[name2];
?>
printf("%s, choose your deck!\n", $name1);
?>
printf("Welcome %s and %s, to the MTG 1v1 room!
\n", $name1,$name2);
printf("%s, select a deck from the list below.
\n", $name1);
?>
Jace Beleren
Ajani Goldmane
Liliana Vess
Garruk Wildspeaker
Chandra Nalaar
Second deck select:
$deck= $_POST[deck]
$name1= $_POST[name1];
$name2= $_POST[name2];
?>
prinf("%s, choose your deck!\n", $name2);
?>
prinf("%s, it is now time to choose your deck from the list below.
/n", $name2);
?>
Jace Beleren
Ajani Goldmane
Liliana Vess
Garruk Wildspeaker
Chandra Nalaar
Thanks to all who read all the code.
nightcreeper58
53 posts
Posted 25 July 2011 at 08:26
Permalink
7 replies
Login to post a comment
Setherial
349 posts
is the filename of the second page Deck_Select2.php? Linux servers are case sensitive, using a capital in your filename is not very good practise. I'm not a php developer so thats the only thing that stands out to me.
0
Posted 25 July 2011 at 09:00
Permalink
nightcreeper58
53 posts
all the file names are correct (should've posted that originally) which is why I posted this in the first place. Thanks anyway Seth.
0
Posted 25 July 2011 at 10:58
Permalink
Setherial
349 posts
have you tried reducing the code to just the form + submit button.
something like this should work
<html>
<body>
<form action=""Deck_Select2.php" method="post">
<input type="submit" />
</form>
</body>
</html>
And if it doesn't it probably means he can't find the file.
If this works simple start adding stuff and test part by part.
0
Posted 25 July 2011 at 12:10
Permalink
nightcreeper58
53 posts
I tried that Seth, and it didn't work. Thanks heeps for that. I'll try creating a new file with a new name and see if that works.
0
Posted 25 July 2011 at 23:52
Permalink
nightcreeper58
53 posts
ok, i remade and renamed the file with this code:
<?php
$deck= $_POST[deck]
$name1= $_POST[name1]
$name2= $_POST[name2]
?>
<html>
<head>
<title><?php
printf("%s, choose your deck\n", $name2);
?>
</title>
</head>
<body bgcolor="blue">
<font color="white" size="5" face="arial">
<?php
printf("%s, choose a deck from the list below. The game will begin when you click the duel! button.\n", $name2);
?>
<form name="decks2" method="post" action="Battlefield.php"><br>
<U>Jace Beleren <img src="blue mana.jpg" width="30"></U><input name="deck2" type="radio" value="deck_1"><br>
<U>Ajani Goldmane <img src="white mana.jpg" width="30"></U><input name="deck2" type="radio" value="deck_2"><br>
<U>Liliana Vess <img src="black mana.jpg" width="30"></U><input name="deck2" type="radio" value="deck_3"><br>
<U>Garruk Wildspeaker <img src="green mana.jpg" width="30"></U><input name="deck2" type="radio" value="deck_4"><br>
<U>Chandra Nalaar <img src="red mana.jpg" width="30"></U><input name="deck2" type="radio" value="deck_5"><br>
<input name="name1" type="text" style="display:none" value="$name1">
<input name="name2" type="text" style="display:none" value="$name2">
<br>
<br>
<input name="submit" type="submit" value="Duel!">
</form>
<br>
<br>
<br>
<img src="Jace Beleren.jpg">
</body>
</html>
When i click the submit button the previous page, it comes up with a HTTP 500 internal server error. If anyone with any sort of programming knowledge has read this, please help. :(
0
Posted 27 July 2011 at 00:37
Permalink
Setherial
349 posts
Who is the owner of the server you are running this on? You'll have to ask him to check his logs to get more info about the error. an HTTP 500 error is not a specific error, it can be anything.
0
Posted 27 July 2011 at 06:44
Permalink
nightcreeper58
53 posts
its ok, it turns out i was missing a few semi-colons at the end of my php statements.
0
Posted 06 August 2011 at 08:03
Permalink
Username:
Password:
Remember Me
Forgot your password
?
Don't have an account yet?
Register now
!
No notifications!