Jump to content

mattal999

Members
  • Posts

    692
  • Joined

  • Last visited

Everything posted by mattal999

  1. im only in year 9 (13 years of age) and its a bit complex. I might just make multiple images. Its a lot easier.
  2. its a bit of a long winded approach... any other suggestions?
  3. your database can't be located on the root: localhost. It might be sql.yourdomain.com. It depends where and how u installed it...
  4. i was wondering how i could use: to use a $speed variable to make a picture, based on the above, showing this speed with the pointer? thanks
  5. on the line that has 'tablename' WHERE username='xxx' && password='xxx''u need only 1 ' on password part: 'tablename' WHERE username='xxx' && password='xxx'
  6. all great programmers make mistakes, its how you deal with them...
  7. try using mysqlnumrows: http://php.net/msql-num-rows Post back if you need help
  8. well, i ran: $query = mysql_query("SELECT id,unique_code FORM tablename WHERE username='$username' && password='$password'") or die(mysql_error()); through a syntax checked and it's ok, cant be that line...
  9. echo "<a href=\'paused.php?'$acc3[groupe_name]''>'$acc3[groupe_name]'</a>"; // no " allowed in echo!
  10. any chance of an example? i really am quite lost here ??? ???
  11. <form action='nothing.php' method='GET'> <select name='name'> <?php parse_str("$QUERY_STRING"); $db = mysql_connect("localhost", "username","password") or die("Could not connect."); if(!$db) die("no db"); if(!mysql_select_db("dbname",$db)) die("No database selected."); $acc1="SELECT * from zipcodes"; $acc2=mysql_query($acc1) or die("Could not select accounts."); while($acc3=mysql_fetch_array($acc2)) { echo "<option value='$acc3[account_name]'>$acc3[search_id]</option>"; // was $query[account_name] - not set, i set $acc3 - this was my old one } ?> </select> <input type='submit' name='submit' value='Submit'> </form>
  12. no, im sorry, im not making this clear... How do i make it check if the date and time of the last race was 12 hours ago? hopefully that clears it up?
  13. i can make the dates and everything but how can i make it automated that he user gets another race at this point?
  14. well, i made this, can anyone make any better plz???????
  15. each person is allowed two races a day soz for cunfuzzlation...
  16. i tried this, but it needs to change a postcode like "BR1 TWO" to just "BR1": check.php <?php $postcode = $_POST['postcode']; $postcode = strtoupper($postcode); $postcode = stripslashes($postcode); $area1='BR1'; $area2='BR2'; $area3='BR3'; if ($postcode == $area1) { echo ("$postcode is in area!!!"); } else if ($postcode == $area2) { echo ("$postcode is in area!!!"); } else if ($postcode == $area3) { echo ("$postcode is in area!!!"); } else if($postcode == "") { echo "Invalid Postcode"; } else { echo "Sorry, the postcode $postcode is outside of our work region"; } ?> and you need to do is make a page: index <form action='check.php' method='POST'> <input type='text' name='postcode' size="20"><br><input type='submit' value='Check'> EDIT: edit check.php: $postcode = $_POST['postcode']; $postcode = strtoupper($postcode); $postcode = stripslashes($postcode); $postcode = substr($postcode, 0, 3);
  17. i have a page, gorace.php, that lets users have a race. When the race is finished (javascript) then the page goes to wither won.php, or lost.php whch adds the value of 1 onto racestoday in a mysql table. my question is: How can i make it limited to 2 races a day? thanks!
  18. try running it 5 times or more in frontpage or somthing that will show errors. it doesnt do it all the time, just sometimes
  19. <form action='accounts.php' method='GET'> <select name='name'> <?php parse_str("$QUERY_STRING"); $db = mysql_connect("[your host - usually "localhost"]", "[your username]","[your password]") or die("Could not connect."); if(!$db) die("no db"); if(!mysql_select_db("[your database]",$db)) die("No database selected."); $acc1="SELECT * from accounts"; $acc2=mysql_query($acc1) or die("Could not select accounts."); while($acc3=mysql_fetch_array($acc2)) { echo "<option value='$query[name]'>$query[name]</option>"; } ?> </select> <input type='submit' name='submit' value='Submit'> </form> that would connect to a mysql database, select table accounts with one field, name, and print all the rows.
  20. you need to make a table in your database called tablename or clients or whatever (change this on the code aswell where it says "tablename"). create 2 fields, username and passsword. Input all the people. Make the users folder and subfolders of all the usernames. Ta da! However, this is not a secure login man, anyone could go in the folder users/john/index.php! U need to make a secure login. where it says $location='blahblah'; add this line above it: session_register("username"); and at the start, after the <? tags <? session_start(); and then, in the users/{username}/index.php file add at the top: <? session_start(); if(!ISSET($_SESSION['username'])) { die "You are not logged in!"; } ?> hope that doesn't confuse you there you go, sorted
  21. or you could delete the code and replace with this: <html><head><script type="text/javascript"> /*********************************************** * Local Time script- © Dynamic Drive (http://www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit http://www.dynamicdrive.com/ for this script and 100s more. ***********************************************/ var weekdaystxt=["Sun", "Mon", "Tues", "Wed", "Thurs", "Fri", "Sat"] function showLocalTime(container, servermode, offsetMinutes, displayversion){ if (!document.getElementById || !document.getElementById(container)) return this.container=document.getElementById(container) this.displayversion=displayversion var servertimestring=(servermode=="server-php")? '<? print date("F d, Y H:i:s", time())?>' : (servermode=="server-ssi")? 'September 26, 2007 13:50:07' : '<%= Now() %>' this.localtime=this.serverdate=new Date(servertimestring) this.localtime.setTime(this.serverdate.getTime()+offsetMinutes*60*1000) //add user offset to server time this.updateTime() this.updateContainer() } showLocalTime.prototype.updateTime=function(){ var thisobj=this this.localtime.setSeconds(this.localtime.getSeconds()+1) setTimeout(function(){thisobj.updateTime()}, 1000) //update time every second } showLocalTime.prototype.updateContainer=function(){ var thisobj=this if (this.displayversion=="long") this.container.innerHTML=this.localtime.toLocaleString() else{ var hour=this.localtime.getHours() var minutes=this.localtime.getMinutes() var seconds=this.localtime.getSeconds() var ampm=(hour>=12)? "PM" : "AM" var dayofweek=weekdaystxt[this.localtime.getDay()] this.container.innerHTML=formatField(hour, 1)+":"+formatField(minutes)+":"+formatField(seconds)+" "+ampm+" ("+dayofweek+")" } setTimeout(function(){thisobj.updateContainer()}, 1000) //update container every second } function formatField(num, isHour){ if (typeof isHour!="undefined"){ //if this is the hour field var hour=(num>12)? num-12 : num return (hour==0)? 12 : hour } return (num<=9)? "0"+num : num//if this is minute or sec field } </script></head><body><p align="left"><b>Server Time:</b> <span id="timebox"></span> <script type="text/javascript"> new showLocalTime("timebox", "server-ssi", 0, "short") </script>
  22. im not familiar with javascript, but you could try changing server-mode to 'server-ssi' im not really sure...
  23. no, i mean like 32 pixel wide, 16 px high. cartoony, for a game im making...
×
×
  • 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.