-
Posts
1,008 -
Joined
-
Last visited
Everything posted by spiderwell
-
Need Help Adding a file size filter to this script in KB
spiderwell replied to kinitex's topic in PHP Coding Help
bottom left, solved button, -
Need Help Adding a file size filter to this script in KB
spiderwell replied to kinitex's topic in PHP Coding Help
no problem, i like things like this as i had no clue myself until i went looking so it teaches me too -
Need Help Adding a file size filter to this script in KB
spiderwell replied to kinitex's topic in PHP Coding Help
you prob need to add the full path?, i forgot to add it in -
ive been doing it about 1.2 years, you'll prob help me more than the other way around
-
Need Help Adding a file size filter to this script in KB
spiderwell replied to kinitex's topic in PHP Coding Help
<?php if( substr($val,-4)=='.txt' && (filesize($val) > 1000)) //file is > 1kb ?> this might work -
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? ?>
-
theres no php, you should get a mod to move it to javascript, you might get a better response.
-
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 }
-
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.
-
Implementing search on a displayed table
spiderwell replied to agendra1003@gmail.com's topic in PHP Coding Help
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 -
Store data into php file without being directed to that page
spiderwell replied to Bentley4's topic in PHP Coding Help
i was about to suggest writing to text file, seems you already found it! -
try echo $_POST['provincias']; notice the extra ' ' in there
-
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"
-
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
-
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
-
Passing array from php to javascript using html button
spiderwell replied to ajeesh.tr's topic in Javascript Help
php doesn't talk to javascript and vice versa. what exactly are you trying to achieve -
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; }
-
click on link to display dropdown help needed pls
spiderwell replied to helloise's topic in PHP Coding Help
not in this section well you might get lucky, but you should ask a move to move this to javascript -
get a specfic user details from mysql database using php?
spiderwell replied to jgkgopi's topic in PHP Coding Help
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 -
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
-
true fact & possible future siggie: "Anything I can do, gizmola can do better"
-
you are the man to do that as the lone ranger supposedly once said 'my work here is done'
-
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'
-
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.
-
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