Jump to content

Help with 2 Errors


MxpUnk

Recommended Posts

Well, I'm creating a form, that sends info the the db, so it will make a clan/crew/team, or whatever you wanna call them (for an online game) and when I go to the createcrew.php page (where the problem is occuring) I get some errors.

 

My errors:

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/elitewar/public_html/createcrew.php on line 78

 

Fatal error: Cannot redeclare to_money() (previously declared in /home/elitewar/public_html/header.php:49) in /home/elitewar/public_html/header.php on line 49

 

 

 

My code:

<? include('header.php') ?>

<table width="100%">



                        <tr><td colspan="2" align="center">::.. Create Crew ..::</td></tr>



                <form name="form1" method="post" action="viewcrewprofile.php?view=$crew[id]">



                <tr><td><b>Name:</b></td><td><input name="name" type="text" id="$name" size="30"></td></tr>



                <tr><td><b>Rank1:</b></td><td><input name="r1" type="text" id="$rank1" size="15"></td></tr>



                <tr><td><b>Rank2:</b></td><td><input name="r2" type="text" id="$rank2" size="15"></td></tr>



                <tr><td><b>Rank3:</b></td><td><input name="r3" type="text" id="$rank3" size="15"></td></tr>



                <tr><td><b>Rank4:</b></td><td><input name="r4" type="text" id="$rank4" size="15"></td></tr>




                <tr><td colspan="2" align="center">Description</td></tr>



                <tr><td colspan="2" align="center"><textarea rows="5" cols="50" name="$description"></textarea></td></tr>



                <input type=hidden name="leader" value="20061">


                 



                </form>



                </table>
                 <form>

<Center> <form>
<input type=button value="Create Crew!"
onClick="window.open('viewcrewprofile.php?vew=$crew[id]')">
</form>
<?php

$name = ($_POST['name']);
$rank1 = ($_POST['rank1']);
$rank2 = ($_POST['rank2']);
$rank3 = ($_POST['rank3']);
$rank4 = ($_POST['rank4']);
$description = ($_POST['description']);
if ($name || $rank1 || $rank2  || $rank3 || $rank4 || $description) {
   echo "
You must include all fields of the form. Try again.";   include('createcrew.php');   
exit;
}


$sql = "INSERT INTO `crew` VALUES ('', '$id' '$name', '$rank1', '$rank2', '$rank3', '$rank4', '$description')";
if (mysql_query($sql, $connect))
{
echo "Thank you $name, your crew was created!.";

echo "Your crew id is $crew[id].";
} else
{
include('createcrew.php');
echo "Sorry $stat[user], your crew could not be created."; }
?>
</Center>






<script type="text/javascript" src="/i.js"></script>

 

 

I'm trying to make it, so if you dont fill out all fields, it asks you to fill them out.. But when I miss a field and click create, it doesn't give me any errors, or anything. It just refreshes to the page "viewcrewprofile.php". I'm also trying to make it so when you create, it creates a new crew, that include: $id, $name, $rank1, $rank2, $rank3, $rank4 $description, and i'd also like it to show the leader (the person who owns the crew), and also how many users there are. I'm stumped on the last 2, (leader, and total users) so that is also a part of my other question. :P

 

 

I've added the link, so when you click create, it goes to "crewprofile.php?view=crew[id]" - I'm not sure if that is correct, so thats another question. :D

 

 

I'm sorry for all the questions i just asked :D I guess you can say i'm stumped.. :D well if you know any problems, or see something wrong in my code, or know why the errors are occuring, please let me know. :) Also, if you know the leader, and total users problem, shout that! :)

 

Thank you, and hope you all can try and help! (ps: i didn't code the profile yet, would that have an effect?)

 

 

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.