desjardins2010
-
Posts
187 -
Joined
-
Last visited
Posts posted by desjardins2010
-
-
hey all;
I have a member.php page filled with html and some php, at the top the first thing it does is check for a session if it's not present it displays Sorry you must be logged in to view this page if it's there is says welcome blah blah blah
problem is even if it's not present it's showing all the rest the content under the sorry you must be logged in to view this page..
tried adding an exit; did the same thing showed content and tried die; did the same thing showed content?
-
This script was working fine yesterday i havn't changed anything?? not it don't register the user upon completing the script no error, just when you hit submit it refreshes and does nothing?
<?php //check for submit $submit =$_POST['submit']; //gather POST variable $fullname =strip_tags($_POST['fullname']); $email =strip_tags($_POST['email']); $username =strip_tags($_POST['username']); $password =strip_tags($_POST['password']); $password2 =strip_tags($_POST['password2']); if ($submit) { //check that fields were filled in if ($fullname&&$email&&$username&&$password&&$password2) { //check to see if our two password fields match if ($password==$password2) { $password = md5($password); // register the user //open database $connect = mysql_connect("localhost", "root", ""); mysql_select_db("users"); //begine insert $queryreg = mysql_query("INSERT INTO members VALUES ('','inet_aton('127.0.0.1')','$fullname','$email','$username','$password')"); if ($queryreg) { echo "Thanks, For Registering! Click <a href=\"index.php\">HERE</a>To Login!"; } } //otherwise if passwords don't match else { echo "<font color='red'>The passwords you entered do not match</font>"; //end of checking password } } else { echo "<font color='red'>Please enter all fields!</font>"; } } //end check for submit ?> <form action='testreg.php' method="post"> <table align="center"> <tr> <td> Your Full Name: </td> <td> <input type="text" name="fullname" value="<?php echo $fullname; ?>"> </td> </tr> <tr> <td> Email Address: </td> <td> <input type="text" name="email" value="<?php echo $email; ?>"> </td> <tr> <td> Choose Username: </td> <td> <input type="text" name="username" value="<?php echo $username; ?>"> </td> </tr> <tr> <td> Password: </td> <td> <input type="password" name="password"> </td> </tr> <tr> <td> Retype Password: </td> <td> <input type="password" name="password2"> </td> </tr> </table> <p> <center><input type="submit" name="submit" value="Register"></center> </form>
-
aww shoot thanks man, sometime get another set of eyes... srry
-
line 11 the while loop
<?php //include connect $connect = mysql_connect("localhost","root","") or die ("Could Not Connect To Server"); mysql_select_db('npcs') or die ("Could Not Select Database"); $query = mysql_query("SELECT * FROM npc WHERE LEVEL=1") or die ("Could Not query Database"); echo "<table width='220' border='1' align='center'><tr><th>NPC NAME</th><th>JOB DESCRIPTION</th></tr><tr><th>LEVEL</th></tr><tr><th>EXPERIENCE</th></tr><tr><th>CASH</th></tr><tr><th>REPUTATION</th></tr>" while ($row = mysql_fetch_array($query)) { //set varibles from query $npcname = $row['npcname']; $level = $row['level']; $jobdes = $row['jobdes']; $exper = $row['exper']; $cash = $row['cash']; $rep = $row['rep']; //end getting varibles echo "<tr align='center'><td>{$row['npcname']}</td><td>{$row['jobdes']}</td><td>{$row['level']}</td><td>{$row['exper']}</td><td>{$row['cash']}</td><td>{$row['rep']}</td></tr>"; } ?>
-
hmmm that makes sence... but to add the IP to database when they register lets say they are going to be given a few initial values level, ip, cash extt i can't just say insert into blah blah blah 192.169.1.1 I have to enter it as an inet_iton???
-
I'm reading the inet_aton functions now... so setting up the database though I have a field called IPadress so I enter anything in there? to compare too? not sure how to accomplish this I see the fucntion calls for a mathamatical equation that will convert the IP to a numaric number but how do I get the inital entry?
-
I'm trying to get a field in the data base to accept the value 192.168.1.1 or an IP address for that matter I have tried decimal and bigint all come back cutting it and only showing 192
-
Hello All;
Ok, I had a file created but it wouldn't let me upload soooo I'm going to post it instead. Read though it post comments see if we can get this completed....
HEAVENSHACKERS
The Quest/Job Engine
“first I wanna say I’ll be using this code you provide as a reference for myself to create the script, your code will show me how things need to be put together to accomplish what I’m looking to do”
Description;
This engine is in place to serve users quests/jobs via a virtual online web browser. From a point to point perspective it would flow like this:
Login to getjob.php -- presented with (see image 1.0) -- click to except a job -- job changes to accepted with a link to hand in job -- user performs task as job details -- user comes back to getjob.php -- clicks hand in -- the system will check to see if the job was completed -- if it was -- say “Thanks for doing this for me here is your reputation points, experience points and cash” -- system would update users account with said values -- user can then complete others with the same.
To accomplish this engine you should create a database with the table ‘members’ and fields ‘id,username,IPaddress,experience,reputation,cash,log’ and another for NPC (non player computers) this will be where the jobs come from, so if we create JOE BLOW as you can see in image 1.0 he is serving 2 jobs…JOE BLOW has also an IPaddress,username,log,joblog the joblog is what the system will check agaist to see if the job was completed see figure 1.5 my thoughts are when any task is completed from the job so if it called for user to delete a file from IPaddress 1.1.1.1 user would visit 1.1.1.1 all database stored find the file delete it the joblog would record users IPaddress deleting file xxxx from IPaddress 1.1.1.1 at said time, when the users goes back to hand in job it would check that joblog for that NPC to see if a match is found for users IPaddress deleting file needed if yes give user points if no tell him to go complete it.
[attachment deleted by admin]
-
srry error is Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/heaven/public_html/tester/view_thread2.php on line 19
Posted By:
-
or should I say can you tell me WHAT is wrong?
getting error on line 19 Parse error: syntax error, unexpected '[' in /home/heaven/public_html/tester/view_thread2.php on line 19
<?php include("connect.php"); mysql_select_db("heaven_forum") or die ("Could Not Select Database"); $recent = mysql_query("SELECT phpbb_posts.id AS post_id, phpbb_posts.topic_id AS topic_id, phpbb_posts.forum_id AS forum_id, phpbb_posts.poster_id AS poster_id, phpbb_topics.topic_title AS title, phpbb_users.username AS usernameFROM phpbb_posts, phpbb_topics ON phpbb_posts.topic_id=phpbb_topics.id, users ON phpbb_posts.poster_id=users.idORDER BY post_time DESC LIMIT 5"); //pull array $recent_row = mysql_fetch_assoc($recent); //set varibles pulled $topic_name = $recent ['title']; $poster = $recent['usernameFROM']; echo $topic_name; echo "Posted By: $poster"; ?>
-
Thanks alot guys, I think I can manage this now.. thats great I love this place btw!
cheers
-
Hey All?
so I have thsi script in place that returns the last 5 forum post based on time, however I have also set them to an array returning all 5 results
I want to be ablet to plug the first on in somewhere then plug the second somewhere and so forth...
I tried to use an echo $topic_name but thats shoots out all 5 results..
any ideas? is there a way to use echo and limit the output then use it again and it would start at the second one?
<?php
include("connect.php");
mysql_select_db("heaven_forum");
$recent = mysql_query("SELECT * FROM phpbb_posts ORDER BY post_time DESC LIMIT 5");
while ($recent_row = mysql_fetch_assoc($recent))
{
//get data
$post_id = $recent_row['post_id'];
$topic_id = $recent_row['topic_id'];
$forum_id = $recent_row['forum_id'];
$poster_id = $recent_row['poster_id'];
$post_time = $recent_row['post_time'];
//get topic name
$topic_name = mysql_query("SELECT topic_title FROM phpbb_topics WHERE topic_id='$topic_id'");
$topic_name = mysql_fetch_assoc($topic_name);
$topic_name = $topic_name['topic_title'];
//get username
$username = mysql_query("SELECT username FROM phpbb_users WHERE user_id='$poster_id'");
$username = mysql_fetch_assoc($username);
$username = $username['username'];
echo $topic_name;
echo "Posted By: $username";
}
?>[code=php:0]
-
Is your database field setup to enough charc for the length of the whole city?
-
youtube - phpacademy helped me alot
-
lmao didn't post the link
-
Seems like you need alot more than help seems your looking to have it done for you... check this forum out the video section at the bottom runs you thought the process of building an online mmorpg
best luck!
-
Ahh damit... srry man thanks!!!!
-
isnt' that what r0x just said??
-
getting the same thing just echoing $bankacct no errors??
-
Hey guys i don't know whats up here everything looks ok? it just returning $bankacct instead of pulling the info from the database not getting any errors though that says i'm not connected?
<?php //this script will pull users programs and present them //connect to db $connect = mysql_connect("localhost","removed","removed") or die ("Could not connect to database"); mysql_select_db("heaven_users") or die ("Could not select database"); $query = mysql_query("SELECT * from members WHERE username='Theaf'"); $numrows = mysql_num_rows($query); if($numrows!=0) { while ($row = mysql_fetch_assoc($query)) { //set varibles for values in database $bankacct = $row['bankaccountnumber']; $balance = $row['balance']; $virusscanner = $row['virusscanner']; $passwordcracker = $row['passwordcracker']; $iptracer = $row['iptracer']; echo '$bankacct'; } } else echo "dunno something wrong"; ?>
-
K, I have a page that when viewed in 1366*768 (my resolution) it's fine I don't have to scroll right left up and down to view the page.. however when I view in say anything else your haveing to scroll up and down left and right... how can I make it that it's static for every resolution?? or can I
-
Hey Guys/Gals
I have a page that resembles your desktop the issue were having is that when you view the page you have to scroll up and down left and right and this isn't what we want.. we want it to be full screen no scrolling needed for any user regardless of there resolution being used..
how can I accomplish this?
-
AHHHHHH your great man thanks alot... that works like a dream I had it set to 15 char
-
in register.php I'm entering a password of 0614jef and it echos 0614jef then would encypt it to be md5, values in login should be matching this kinda makes no sence?
exit script from showing
in PHP Coding Help
Posted
THEN...HTML if there is no session I want this not to show if there is and all is well show everything to the validated user