
maxudaskin
Members-
Posts
628 -
Joined
-
Last visited
Everything posted by maxudaskin
-
Would this be correct? The problem is that it shows up blank... <?php mysql_select_db($database_LeadHost, $LeadHost); $result2 = mysql_query("SELECT * FROM `applications` WHERE `id`='{$id}'"); while($row2 = mysql_fetch_array($result2)); ?> <input name="appid" type="text" id="appid" value="<?php echo $row2['apps'] ?>" /> <input name="fname" type="text" id="fname" value="<?php echo $row2['fname'];?>" /> <input name="lname" type="text" id="lname" value="<?php echo $row2['lname'];?>" /> <input name="email" type="text" id="email" value="<?php echo $row2['email'];?>" /> <input name="pass" type="text" id="pass" value="<?php echo $row2['pass'];?>" /> <input name="hub" type="text" id="hub" value="<?php echo $row2['hub'];?>" /> <input name="position" type="text" id="position" value="<?php echo $row2['position'];?>" /> <input name="appdate" type="text" id="appdate" value="<?php echo $row2['appdate'];?>" /> <input name="country" type="text" id="country" value="<?php echo $row2['country'];?>" /> <input name="birthday" type="text" id="birthday" value="<?php echo $row2['birthday'];?>" /> <input name="country" type="text" id="country" value="<?php echo $row2['country'];?>" /> <input name="vatsim" type="text" id="vatsim" value="<?php echo $row2['vatsim'];?>" /> <input name="ivao" type="text" id="ivao" value="<?php echo $row2['ivao'];?>" /> <input name="ip" type="text" id="ip" value="<?php echo $row2['ip'];?>" /> </div></td> </tr> </table> <br /> <input name="accept" type="submit" class="buttons" id="accept" value="Accept" /> </div> </form>
-
LMAO... I got myself in a prediciment... again. :P
maxudaskin replied to maxudaskin's topic in PHP Coding Help
BUMP -
LMAO... I got myself in a prediciment... again. :P
maxudaskin replied to maxudaskin's topic in PHP Coding Help
You mean actually printing onto paper or is it something else? Yes the whole script for the two pages. -
LMAO... I got myself in a prediciment... again. :P
maxudaskin replied to maxudaskin's topic in PHP Coding Help
That is the only page that uses that table. -
LMAO... I got myself in a prediciment... again. :P
maxudaskin replied to maxudaskin's topic in PHP Coding Help
-
Ok... there is a part in the middle where it is 'echo'ing the information from the table. I want it to get the information from the table and send it to the next page (bottom), the next page uploads it to another table. But when I check the database, what it uploads is "Resource id #5" with the number being different for every entry. Does anyone see where I went wrong? checkapplicants.php <form id="user" name="user" method="get" action="<?=$PHP_SELF; ?>"> <div align="center"> <select name="apps" class="dropdown"> <option value="0" <?php if (!(strcmp(0, $row_Recordset1['id']))) {echo "selected=\"selected\"";} ?>>Select One</option> <?php do { ?> <option value="<?php echo $row_Recordset1['id']?>"<?php if (!(strcmp($row_Recordset1['id'], $row_Recordset1['id']))) {echo "selected=\"selected\"";} ?>><?php echo $row_Recordset1['lname']?></option> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); $rows = mysql_num_rows($Recordset1); if($rows > 0) { mysql_data_seek($Recordset1, 0); $row_Recordset1 = mysql_fetch_assoc($Recordset1); } ?> </select> <br /> <br /> <input name="Submit" type="submit" class="buttons" value="View Applicant" /> <br /> </div> </form> <div align="left"> <?php $id = $_GET['apps']; $result = mysql_query("SELECT * FROM `applications` WHERE `id`='{$id}'"); if($_GET["Submit"]) { while($row = mysql_fetch_array($result)) { echo $row['fname'] . " " . $row['lname']; echo "<br />"; echo "<br />";?> <strong> Email </strong><br /> <?php echo $row['email'] . " | " . $row['emailver']; echo "<br />"; echo "<br />"; ?> <strong> Password </strong><br /> <?php echo $row['pass'] . " | " . $row['passver']; echo "<br />"; echo "<br />"; ?><strong> Hub </strong><br /> <?php echo $row['hub']; echo "<br />"; echo "<br />"; ?><strong> Country </strong><br /> <?php echo $row['country']; echo "<br />"; echo "<br />"; ?><strong> Birthday (DD/MM/YYYY) </strong><br /> <?php echo $row['birthday']; echo "<br />"; echo "<br />"; ?><strong> Vatsim ID </strong><br /> <?php echo $row['vatsim']; echo "<br />"; echo "<br />"; ?><strong> Internation Virtual Aviation Organisation ID (IVAO) </strong><br /> <?php echo $row['ivao']; echo "<br />"; echo "<br />"; ?><strong> Position </strong><br /> <?php echo $row['position']; echo "<br />"; echo "<br />"; ?><strong> Resumé </strong><br /> <?php echo $row['reason']; echo "<br />"; echo "<br />"; ?><strong> Submission Date </strong><br /> <?php echo $row['appdate']; echo "<br />"; echo "<br />"; ?><strong> IP Address </strong><br /> <?php echo $row['ip']; echo "<br />"; echo "<br />"; } ?> </div> <form id="goback" name="adduser" method="post" action="adduser.php"> <div align="center"> <table width="210" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="210"><div align="left"> <select name="role" id="role"> <option value="0">Pilot</option> <option value="1">Staff</option> </select> Access Restrictions<br /> <select name="hub" id="hub"> <option value="1000">YYZ</option> <option value="2000">YVR</option> <option value="3000">LHR</option> </select> Hub<br /> <?php $result2 = mysql_query("SELECT * FROM `applications` WHERE `id`='{$id}'"); while($row2 = mysql_fetch_array($result2)); ?> <input name="appid" type="hidden" id="appid" value="<?php echo $row2['apps'] ?>" /> <input name="fname" type="hidden" id="fname" value="<?php echo $row2['fname'];?>" /> <input name="lname" type="hidden" id="lname" value="<?php echo $row2['lname'];?>" /> <input name="email" type="hidden" id="email" value="<?php echo $row2['email'];?>" /> <input name="pass" type="hidden" id="pass" value="<?php echo $row2['pass'];?>" /> <input name="hub" type="hidden" id="hub" value="<?php echo $row2['hub'];?>" /> <input name="position" type="hidden" id="position" value="<?php echo $row2['position'];?>" /> <input name="appdate" type="hidden" id="appdate" value="<?php echo $row2['appdate'];?>" /> <input name="country" type="hidden" id="country" value="<?php echo $row2['country'];?>" /> <input name="birthday" type="hidden" id="birthday" value="<?php echo $row2['birthday'];?>" /> <input name="country" type="hidden" id="country" value="<?php echo $row2['country'];?>" /> <input name="vatsim" type="hidden" id="vatsim" value="<?php echo $row2['vatsim'];?>" /> <input name="ivao" type="hidden" id="ivao" value="<?php echo $row2['ivao'];?>" /> <input name="ip" type="hidden" id="ip" value="<?php echo $row2['ip'];?>" /> </div></td> </tr> </table> <br /> <input name="accept" type="submit" class="buttons" id="accept" value="Accept" /> </div> </form> <div align="left"> <?php } ?> adduser.php <?php $id = $_POST["appid"]; $hub = $_POST["hub"]; $huba = $hub/1000; $rand = rand(001,999); $temppid = $hub+$rand; $fname = $_POST["fname"]; $lname = $_POST["lname"]; $email = $_POST["email"]; $pass = $_POST["pass"]; $position = $_POST["position"]; $type = $_POST["role"]; $appdate = $_POST["appdate"]; $birthday = $_POST["birthday"]; $country = $_POST["coutry"]; $vatsim = $_POST["vatsim"]; $ivao = $_POST["ivao"]; $ip = $_POST["ip"]; $result = mysql_query("SELECT * FROM `users` WHERE `pid`='{$temppid}'"); if (mysql_num_rows($result) == 1) { $pidcheck = 1; } else { $pidcheck = 0; } do { $$temppid++; } while ($pidcheck==1); if ($pidcheck==0); { $pid = $temppid; $sql="INSERT INTO users (appid, fname, lname, email, pass, hub, birthday, country, vatsim, ivao, position, ip, acceptdate, appdate, type, pid) VALUES ('$id','$fname','$lname','$email','$pass','$hub','$birthday','$country','$vatsim','$ivao','$position','$ip', NOW( ), '$appdate', '$type', $pid)"; if (!mysql_query($sql,$LeadHost)) { die('Error: ' . mysql_error()); } echo "1 user added..."; echo "</br>"; echo "</br>"; echo "Thank you For Using Max Udaskin's Virtual Airline Administration Script."; } ?>
-
Is this good? Would it make sure $temppid is unique? $id = $_GET["apps"]; $hub = $_GET["hub"]; $huba = $hub/1000; $rand = rand(001,999); $temppid = $hub+$rand; $result = mysql_query("SELECT pid FROM `users` WHERE `pid`='{$temppid}'"); if (mysql_num_rows($result) == 1) { $pidcheck = 1; } else { $pidcheck = 0; } do { $$temppid++; } while ($pidcheck==1);
-
[SOLVED] I feel obligated to donate to PHP Freaks.
maxudaskin replied to maxudaskin's topic in PHP Coding Help
Well... I still would need a credit card or pay pal. -
That would do it...
-
I am using rand() so that we do not have to input a pid (Pilot ID) each time. We want it to be random but unique.
-
I want $pid to be unique so it can be added to the database and be the only of that number. SCRIPT UPDATE: $id = $_GET["apps"]; $hub = $_GET["hub"]; $huba = $hub/1000; $rand = rand(001,999); $temppid = $hub+$rand; $result = mysql_query("SELECT pid FROM `users` WHERE `pid`='{$temppid}'"); if (mysql_num_rows($result) == 1) { $pidcheck = 1; } else { $pidcheck = 0; } echo $pidcheck;
-
How would I be able to make $pid unique in the event that it is already taken?
-
$rand = rand(001,999); $pid = $hub+$rand;
-
Only problem is that I am broke (only 15 and self taught PHP)... Look at these statics: Just for the PHP Help SubForum, maxudaskin, jitesh, GingerRobot, btherl, suma237, mmarif4u, Yesideez, glenelkins, rameshfaj, Nikos7, tomecafe, thejake420, spur18, Fryman40, jagguy and 100 Guests are viewing this board.
-
How do I make a variable unique to a set in a database? This is what I got so far... Should I change anything? $id = $_GET["apps"]; $hub = $_GET["hub"]; $huba = $hub/1000; $rand = rand(001,999); $temppid = $hub+$rand; $result = mysql_query("SELECT pid FROM `users` WHERE `pid`='{$temppid}'"); if($result==$temppid) { $pidcheck = 1; } else { $pidcheck = 0; } if($pidcheck = 0) { $pid = $temppid; } else { }
-
It is automatic.
-
How would I compare $pid to data in the bring back 0 for not match and 1 for match? $hostname_LeadHost = "***"; $database_LeadHost = "***"; $username_LeadHost = "***"; $password_LeadHost = "***"; $LeadHost = mysql_pconnect($hostname_LeadHost, $username_LeadHost, $password_LeadHost) or trigger_error(mysql_error(),E_USER_ERROR); $id = $_GET["apps"]; /* Ignore */ $hub = $_GET["hub"]; $huba = $hub/1000; /* Ignore */ function assignpid() { $rand = rand(001,999); $pid = $hub+$rand; $result = mysql_query("SELECT pid FROM `users` WHERE `pid`='{$pid}'"); }
-
I mean... I don't know how to get the information to compare. $hostname_LeadHost = "***"; $database_LeadHost = "***"; $username_LeadHost = "***"; $password_LeadHost = "***"; $LeadHost = mysql_pconnect($hostname_LeadHost, $username_LeadHost, $password_LeadHost) or trigger_error(mysql_error(),E_USER_ERROR); $id = $_GET["apps"]; /* Ignore */ $hub = $_GET["hub"]; $huba = $hub/1000; /* Ignore */ function assignpid() { $rand = rand(001,999); $pid = $hub+$rand; $result = mysql_query("SELECT pid FROM `users` WHERE `pid`='{$pid}'"); } What would I put in the parentheses in if() ?
-
If you use dreamweaver, you can use the Put File feature incorporated into it. You will need to set it up in the site manager.
-
How would I go around getting information from a database and comparing it to some page generated information... $hub = $_GET["hub"]; $rand = rand(001,999); $pid = $hub+$rand; I want it to compare $pid to information in a database and if that number is already being used, to redo the script. I know how to get it to re-do the script... I need to know how to compare to a db.
-
Thanks!!
-
Is this correct? mysql_fetch_array('SELECT * FROM `applications` WHERE `id` = ' . $id) I get an error: mysql_fetch_array(): supplied argument is not a valid MySQL result resource