kpetsche20 Posted November 19, 2008 Share Posted November 19, 2008 Hello, I am trying to make a form display on my page, but it will not show up. I've tried just using the form code and it works fine on an html page. here is the code <?php include("classes/privateleague.class.php"); $private = new private_league(); $league = $_GET['league']; if($private->check_if_user_exists_in_league($league, $_SESSION['id'])) { //Displays league details $sql = mysql_query("SELECT * FROM pleagues WHERE id='".$league."'") or die(mysql_error()); echo "<b>League Details:</b><br>"; while($data2 = mysql_fetch_array($sql)) { $exp_date = $data2['startdate']; $idd = $data2['id']; echo "Name: ".$data2['name']."<br> Start Date: ".$data2['startdate']."<br> End Date: ".$data2['enddate']."<br> Total players per team: ".$data2['totalplayerallowed']."<br> Total players value: ".$data2['totalplayervalue']."<br> "; if($data2['owner'] == $_SESSION['id']) { echo "<a href=\"index.php?p=editleague&id=".$data2['id']."\"><font size=\"1\">Edit league</font></a><br>"; echo "<a href=\"index.php?p=manageusers&id=".$data2['id']."\"><font size=\"1\">Manage Users</font></a><br><br>"; } } if($_GET['league']) { //Display Users Teams for a Private League $sql2 = mysql_query("SELECT * FROM pteams WHERE league='".$league."'") or die(mysql_error()); echo "<b>My Teams</b><br />"; while($data = mysql_fetch_array($sql2)) { if($data['userid'] == $_SESSION['id']) { echo "".$data['name']."<br><br>"; } } } ?> <a href="index.php?p=viewpteams&league=<?php echo $league ?>">View all league teams</a><br> <?php $todays_date = date("Y-m-d"); $today = strtotime($todays_date); $expiration_date = strtotime($exp_date); if ($expiration_date > $today) { $valid = "yes"; } else { $valid = "no"; } if($valid == 'yes') { echo $valid; ?> <?php $sql666 = mysql_query("SELECT * FROM pleagues WHERE id = '".$_GET['id']."'") or die(mysql_error()); while($data66 = mysql_fetch_array($sql666)) { ?> <form action="index.php?p=pjoin" method="POST"> <input type="hidden" value="<?php echo $_GET['id'] ?>" name="id" /> <input type="hidden" value="<?php echo $data66['totalplayervalue'] ?>" name="totalvalue" /> <input type="hidden" value="<?php echo $data66['totalplayerallowed'] ?>" name="players" /> <input type="hidden" value="<?php echo $_GET['id'] ?>" name="price" /> <input type="hidden" value="<?php echo $data66['name'] ?>" name="name" /> <input type="text" value="name" name="name" /> <input type="submit" value="submit" name="submit" /> </form> <?php } ?> <? echo "<a href=\"index.php?p=lp&id=$idd\">Create another team</a>"; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/133348-solved-form-not-showing-up-inside-php-code-but-works-fine-if-plain-html/ Share on other sites More sharing options...
Philip Posted November 19, 2008 Share Posted November 19, 2008 If you're not seeing the form, check your query & loop. Try adding this after your query: echo mysql_num_rows($sql666); Quote Link to comment https://forums.phpfreaks.com/topic/133348-solved-form-not-showing-up-inside-php-code-but-works-fine-if-plain-html/#findComment-693515 Share on other sites More sharing options...
kpetsche20 Posted November 19, 2008 Author Share Posted November 19, 2008 THANKS! Quote Link to comment https://forums.phpfreaks.com/topic/133348-solved-form-not-showing-up-inside-php-code-but-works-fine-if-plain-html/#findComment-693523 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.