Jump to content

spiderwell

Members
  • Posts

    1,008
  • Joined

  • Last visited

Everything posted by spiderwell

  1. no problem, i like things like this as i had no clue myself until i went looking so it teaches me too
  2. you prob need to add the full path?, i forgot to add it in
  3. ive been doing it about 1.2 years, you'll prob help me more than the other way around
  4. <?php if( substr($val,-4)=='.txt' && (filesize($val) > 1000)) //file is > 1kb ?> this might work
  5. this should point you in the right direction, it would need altering to test it with your database values <?Php $date = strtotime("2011-05-03"); echo date("y-m-d H:i:s",$date); ?> <?php date("y-m-d H:i:s",$row['STartDate']); //is the T in StartDate a typo? ?>
  6. theres no php, you should get a mod to move it to javascript, you might get a better response.
  7. because the if (!$db) bit i think, that says if not database connection do the while loop, because there is one it then skips the while statement you should try <?php if ($db) { $result = mysql_query ($query); while ($row = mysql_fetch_assoc($result)){ echo "<TABLE border = \"1\" width=\"300\>\n" //blah blah }//close while }//close if $db if ($all==0) { //blah blah }
  8. it doesnt look like you are actually executing the loop with all the info to echo out due to the if (!$db) while ($row = mysql_fetch_assoc($result)){ in the display partners function at the point of executing this, you havent created a $result.
  9. you need to add a check to see if search form was posted, and then do "select * from tblorder WHERE orderid = " . $_POST['orderid'] as the sql query instead of the "select * from tblorder" one. note i havent put in any error trapping, putting a $_POST variable directly into sql statement is a no no! (and i dont mean double negative makes a plus ), its just to show you how to do it really the above search is only ever going to return 1 record though hope that helps
  10. i was about to suggest writing to text file, seems you already found it!
  11. try echo $_POST['provincias']; notice the extra ' ' in there
  12. just after the login success, you need to execute an sql update setting Status to 1 something like: "UPDATE player SET `status` = 1 WHERE PlayerName=%s AND Password=%s"
  13. i used this page: http://www.intranetjournal.com/php-cms/ and its probably outdated but taught me all i needed to know to get a basic cms of my own design up and running, again its class based with basic oop ideas i also used the one at css tricks its very good
  14. do you want to solve this continuing with javascript/jquery? or do you want to do the pagenation via php only, so the filters applied, you have to submit form and reload the page, rather than using the jqery/ajax method. a standard pagenation is a lot easier to do for obvious reasons, and there are plenty of versions available to find. you might depending on your needs want to get this moved to the ajax/javascript section
  15. php doesn't talk to javascript and vice versa. what exactly are you trying to achieve
  16. it is because you have not defined your keys 0,1,2,3,4 and the $i represents that key. use this too loop through an array instead. foreach ($provincias as $value) { echo $value; }
  17. not in this section well you might get lucky, but you should ask a move to move this to javascript
  18. wrong quotes my friend, you have back ticks ```````````` around a value and you need single quotes ' ' ' ' ' ' ', backticks are used around column names or table names "SELECT * FROM `final` WHERE `name`='$username' then you should be ok
  19. please give us moer information. you state you are using javscript, what for exactly? pagenation and filters are normally 'dealt with' by the php . where is your page you have problems with, and code? when pagenation is in place with a filter, remember to pass all info to each page of results, so it 'remembers' the filters you can see this when you hover on the links for page 2,3,4 etc on both your sites when a filter is applied
  20. true fact & possible future siggie: "Anything I can do, gizmola can do better"
  21. you are the man to do that as the lone ranger supposedly once said 'my work here is done'
  22. a recursive function calls itself. it works in this way, a function will open a folder, list all files and folders. while listing, if current item is a folder, pass this folder back to the function and restart the list (this is actually a new list but becomes nested inside orgiinal list) there are plenty of examples of such functions already written out there, just google something like 'file directory recursive php'
  23. i gave up after 5 mins because i couldn't see a way to avoiding the switch function, so it seemed all a bit pointless as it would be just as much code in the end.
  24. ok this works but of course the switch statement will expand with more pages or offers: <?php function updatefile($newcounthandle){ $counthandle=fopen("file.txt","w"); fwrite($counthandle,$newcounthandle); fclose($counthandle); } $counthandle=fopen("file.txt","r"); $getcurrent=fread($counthandle,filesize("file.txt")); fclose($counthandle); echo $getcurrent; switch ($getcurrent){ case "1,1": updatefile("1,2"); //redirect to lp1,offer1 break; case "1,2": updatefile("2,1"); //redirect to lp2,offer1 break; case "2,1": updatefile("2,2"); //redirect to lp1,offer2 break; case "2,2": updatefile("1,1"); //redirect to lp2,offer2 break; default://incase nothing in file or out of specified ranges updatefile("1,2"); //redirect to lp1,offer1 break; } ?> note i have changed around a bit, in text file 1,1 : the first one is landing page, the second 1 is offer going to try an array version now lol but don't hold ya breath lol
×
×
  • 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.