Jump to content

ggkfc

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ggkfc's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Any one found good resources for image overlay- gd or image magick? just basically looking to get a base skeleton and overlay with clothing thanks
  2. im not sure, basically searching through their ips and finding if they have got the same ip in two accounts = ban :S thanks for the posts, i tried rajvs but it sadly doesn't work perhaps my loop thing is wrong as well?
  3. ive got ppl's ips saved in the addr field (table = users) and i want to find those with same ips and print them in a table, is there something im doing wrong? $rs = query("select addr, count(addr) as num from users group by addr having (count(addr) > 1)"); echo "<table><tr><td>addr</td><td>count</td></tr>"; while(list($addr, $count) = mysql_fetch_array($query)) { echo "<tr><td>$addr</td><td>$count</td></tr>"; } echo "</table>"
  4. atm, im still running my php @ local computer so how would i put a cron on that because it seems to be unix only? (the way things are going. i may go the php option- just leave my computer on to auto-refresh all day ) hahaha could you care to clarify the cron stuff for me (ive read about how it works and all that) but how would i run it on my system (homepc)
  5. ty for the reply i was reading up on it, and it seems you need at least one user online @ a time for ticks to work properly. therefor when you're just starting out it wouldn't really work. I also ready something about shell scripts and bash buy couldn't really understand it. could someone verify whether i could use a periodically run shell script to emulate a tick function?
  6. i was wondering- does anyone know how the time/tick function works in popular games like utopia and hobowars? like you regain *energy* to do stuff, how does it work.. is it something you set onto your mysql database or something? like an autoincrement/limited script
  7. i was wanting a like a top frame at the top of all my pages with links and read to use like a include or require once. however, because i have to access the database, would i be able to have it access the database in the header and pick stuff out in the bottom half of the page so i don't need to call on accessing the database on every page? i have a forum and chat thing working well but without the header, but when i incorporate it with a include header.php <?php include "connect.php"; //mysql db connection here include "header.php"; //mysql db connection here <--- added this print "<link rel='stylesheet' href='style.css' type='text/css'>"; print "<A href='post.php'>New Topic</a><br>"; print "<table class='maintable'>"; print "<tr class='headline'><td width=50%>Topic</td><td width=20%>Topic Starter</td><td>Replies</td><td>Last replied time</td></tr>"; $getthreads="SELECT * from forumtutorial_posts where parentid='0' order by lastrepliedto DESC"; $getthreads2=mysql_query($getthreads) or die("Could not get threads"); while($getthreads3=mysql_fetch_array($getthreads2)) { $getthreads3[title]=strip_tags($getthreads3[title]); $getthreads3[author]=strip_tags($getthreads3[author]); print "<tr class='mainrow'><td><A href='message.php?id=$getthreads3[postid]'>$getthreads3[title]</a></td><td>$getthreads3[author]</td><td>$getthreads3[numreplies]</td><td>$getthreads3[showtime]<br>Last post by <b>$getthreads3[lastposter]</b></td></tr>"; } print "</table>"; ?> header = <? require_once 'connect.php'; $rs = query("select ID from users where ID = $user"); print date("H:i:s"); echo " ID: $user<p>"; $rs = query("select * from users where ID = $user"); if ($row = mysql_fetch_assoc($rs)) { $cash = $row['Cash']; $name = $row['Name']; $bank = $row['Bank']; $token = $row['Token']; } else { query("insert into users values (1)"); $cash = 1; } echo "<p>Name: $name</p>"; echo "<p>Cash: $cash</p>"; echo "<p>Bank: $bank</p>"; echo "<p>Token: $token</p>"; ?>
  8. i have my xampp installed and everything working. i used to work with folder called tut and now i use one called app. ive changed the directories so it seems to work fine but every 2nd time i load a page, it gives me a 403 error forbidden. i think the settings are correct because they work half the time when i reload the page. any ideas?
  9. <? require_once 'dbappinclude.php'; $rs = query("select ID from users where ID = $user"); if ($row = mysql_fetch_assoc($rs)) { echo "<p>hello $user</p>"; } else { query("INSERT INTO users (ID) VALUES ($user)"); echo "<p>you have been registered $user</p>"; } $rs = query("select * from users where ID = $user"); if ($row = mysql_fetch_assoc($rs)) { $cash = $row['Cash']; $name = $row['Name']; $bank = $row['Bank']; $token = $row['Token']; } else { query("insert into users values (1)"); $cash = 1; } echo "<p>Name: $name</p>"; echo "<p>Cash: $cash</p>"; echo "<p>Bank: $bank</p>"; echo "<p>Token: $token</p>"; require_once 'freecap_wrap.php'; ?> [code] basically now i have it running index.php running the freecap_wrap inside the only problem is "Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\tut\index.php:6) in C:\xampp\htdocs\tut\freecap_wrap.php on line 2" as in a header/session clash or something because both freecap & freecap_wrap.php use a session start right? or is there something i am missing. thnx in advance [/code]
  10. yes i ahve added it now @ the begginning xD but now i get Access forbidden! You don't have permission to access the requested directory. There is either no index document or the directory is read-protected. If you think this is a server error, please contact the webmaster. Error 403 127.0.0.1 11/24/07 18:30:46 Apache/2.2.6 (Win32) DAV/2 mod_ssl/2.2.6 OpenSSL/0.9.8e mod_autoindex_color PHP/5.2.4
  11. Hello ive tried to use freecap inside my own index.php but its seemed to failed to work. basically i have a form up that loads a users id, name and score. for each time he answers the captcha right, score will increase by one. unfortunately, when i use the freecap_wrap.php it works perfectly fine, displaying whether you typed the right or wrong captcha when you submit. when i copied it into my pre-existing index.php, the refresh function works but the right/wrong thing never turns up (the subsequent increase in score). being a php noob, would any expert mind taking a look at what i have messed up? <? require_once 'dbappinclude.php'; if(!empty($_SESSION['freecap_word_hash']) && !empty($_POST['word'])) { // all freeCap words are lowercase. // font #4 looks uppercase, but trust me, it's not... if($_SESSION['hash_func'](strtolower($_POST['word']))==$_SESSION['freecap_word_hash']) { // reset freeCap session vars // cannot stress enough how important it is to do this // defeats re-use of known image with spoofed session id $_SESSION['freecap_attempts'] = 0; $_SESSION['freecap_word_hash'] = false; // now process form if($word_ok!==false) { if($word_ok=="yes") { echo "you got the word correct, rock on.<br />"; } else { echo "sorry, that's not the right word, try again.<br />"; } } // now go somewhere else // header("Location: somewhere.php"); $word_ok = "yes"; } else { $word_ok = "no"; } } else { $word_ok = false; } $rs = query("select ID from users where ID = $user"); if ($row = mysql_fetch_assoc($rs)) { echo "<p>hello $user</p>"; } else { query("INSERT INTO users (ID) VALUES ($user)"); echo "<p>you have been registered $user</p>"; } $rs = query("select * from users where ID = $user"); if ($row = mysql_fetch_assoc($rs)) { $cash = $row['Cash']; $name = $row['Name']; $bank = $row['Bank']; $token = $row['Token']; } else { query("insert into users values (1)"); $cash = 1; } echo "<p>Name: $name</p>"; echo "<p>Cash: $cash</p>"; echo "<p>Bank: $bank</p>"; echo "<p>Token: $token</p>"; ?> <script language="javascript"> <!-- function new_freecap() { // loads new freeCap image if(document.getElementById) { // extract image name from image source (i.e. cut off ?randomness) thesrc = document.getElementById("freecap").src; thesrc = thesrc.substring(0,thesrc.lastIndexOf(".")+4); // add ?(random) to prevent browser/isp caching document.getElementById("freecap").src = thesrc+"?"+Math.round(Math.random()*100000); } else { alert("Sorry, cannot autoreload freeCap image\nSubmit the form and a new freeCap will be loaded"); } } //--> </script> <form action="<?=$_SERVER['PHP_SELF']?>" method="post"> <table cellpadding="0" cellspacing="0"> <tr><td colspan="2"><img src="freecap.php" id="freecap"></td></tr> <tr><td colspan="2">If you can't read the word, <a href="#" onClick="this.blur();new_freecap();return false;">click here</a></td></tr> <tr><td>word above:</td><td><input type="text" name="word"></td></tr> <tr><td colspan="2"><input type="submit" value="submit"></td></tr> </table><br /><br /> </form>
  12. ty. i was just doing this as a learning project. i was hoping if i did manage to do it, i could post a tutorial of each of my steps as i did it to help other newbies. i will embark on this mission in 2 weeks time! woot!
  13. im a newbie programmer (only proficient in Visual Basic) but im interested in learning php + mysql, so i brought it on myself to see if i could clone hobowars (www.hobowars.com) it seems easy enuf. a mysql to contain information, php to do formulas equations. the forum system and view online etc, im sure i can just get from free source code places. but ive had some difficulty with user authentication (but it has worked- basic only) do you think my task is achievable and are there mentor places for some gurus to help out a newb? if there are any other newbs that would be interested in learning about php + mysql and want to be involved, pm me =) thanks, gg
×
×
  • 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.