Jump to content

dreamwest

Members
  • Posts

    1,223
  • Joined

  • Last visited

    Never

Everything posted by dreamwest

  1. Im trying to get this small javascript to work <script> var loc = document.getElementById("test"); if(loc == true){ document.write("check"); return; } </script> <div id="test"></div> So basically when the page loads and if theres a div called "test" the javascropt will write "check". But ive still got it wrong .....
  2. include is a function <? header('Content-type: image/jpeg'); include('classes/utils/ImageResizer.class.php'); $image = imagecreatefromjpeg('img/1.jpg'); imagejpeg($image); ?>
  3. wheres the function "the_permalink();"? usually a function will use return $var; so you will still need to echo it <div class="storycontent"><?php if($i == 2) { getImage('1'); echo the_content();} ?><div class="contread"><a href="<?php echo the_permalink(); ?>">Read More ยป</a></div></div>
  4. Pagination is simple just follow this: http://www.wizecho.com/nav=extra&s=bits#3
  5. $content = file_get_contents('rapid url'); $find=explode('The file could not be found', $content); if ($find[1] != ""){ echo "Ghost!<br>"; echo "FILE NOT FOUND!!...Deleting <br>"; }else{ //continue }
  6. I need to set an option to direct the php script to the right table of the database based a div id <script> var xmlhttp function showHint(str) { if (str.length==0) { document.getElementById("movie").innerHTML=""; return; } xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="2.php"; url=url+"?"+str; xmlhttp.onreadystatechange=stateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } function stateChanged() { if (xmlhttp.readyState==4) { document.getElementById("movie").innerHTML=xmlhttp.responseText; } } function GetXmlHttpObject() { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } if (window.ActiveXObject) { // code for IE6, IE5 return new ActiveXObject("Microsoft.XMLHTTP"); } return null; }</script> <div style='position:absolute; top:25px; left:0px;' id="movie"></div> Basically i need to add a type to this line based on the div name : so if the div id is movie: <div style='position:absolute; top:25px; left:0px;' id="movie"></div> The javascript will look like this: var url="2.php"; url=url+"?type=movie"+str; OR if the div id is tv: <div style='position:absolute; top:25px; left:0px;' id="tv"></div> The javascript will look like this: var url="2.php"; url=url+"?type=tv"+str;
  7. echo "<script language=Javascript>document.location.href='http://site.com';</script>";
  8. Its a multi threader so it will open all script simutaneously. This spider uses multi curl, just modify it to your prefrences http://www.wizecho.com/nav=scripts&s=spider Scroll down to the "Multi thread" example to see how to inistiate it
  9. if you insist on running 100 script you can try multi handler with curl
  10. No wonder its timing out you 12,000 rows in one hit. 2 solutions: one is to query 20 rows at a time and use LIMIT 1,20, "SELECT * from table LIMIT 1,20" the second is to add a tmp field in the table and make it tinyint, then just select and update rows where tmp ='0' "SELECT * from table WHERE `tmp`='0' LIMIT 1,20" after successful query update the tmp field to 1
  11. Your "real" url wont exist anywhere. So you saying you have a directory like this? http://site.com/#test/
  12. I doubt the single query is taking 2 mins, unless your joining a blog field without indexing it Can you post you "super" query here?
  13. Thats ok if your headers havent been sent, othwise youll need javascript: function redirect( $url ){ if (! headers_sent( ) ){ header( "Location: ".$url ); exit( 0 ); } echo "<script language=Javascript>document.location.href='".$url."';</script>"; exit( 0 ); } redirect('http://www.yoursite.com/'); //redirect to any url
  14. This code certainly can not work, because you do not specify that the query return a column named 'Server' in your query. This might help -- without knowing the structure of your CES table, it's not possible to say for sure. $results = mysql_query("SELECT `Name`, `Server` FROM `CES` WHERE `Name` !='' "); My bad. Im doing 10 things at once ATM. I would add SELECT * if you queries are below 10,000 requests per day
  15. $results = mysql_query("SELECT `Name` FROM `CES` WHERE `Name` !='' "); while($row = mysql_fetch_assoc($results)) { echo "<option value='{$row['Server']}'> {$row['NAME']}</option>"; }
  16. http://www.wizecho.com/nav=scripts&s=ajax_form You can config it to any email or multiple emails
  17. It wont work you need a prefix to seperate the row names eg table 1,2 & 3 all have the same row names Then: SELECT * FROM table1 as a, table2 as b, table3 as c ORDER BY c.price desc
  18. http://wizecho.com/nav=extra&s=bits
  19. Thanks. Problem is it doesnt reduce the amount of code for the query/ies and ill still have 3 queries. I was trying to reduce it to one combined query thus creating less code, easier to remember & less cluttered apps - it may be possible with subqueries, ill have to brush up on that
  20. I recently had the same problem, it was a combination of google hitting bad queries i had made ages ago like 150,000 times a day. I removed order by rand() with the altenate FLOOR(), indexed all query joins , removed live count(*) and just had totals coming from an updated table. First place to look is bots hitting your database driven pages through awstats
  21. I had to remove rand from my queries because my database is over 3 million rows and it was serioulsly affecting the server Is it possible to compress this alternate rand query into one line aka one mysql_query(): $offset_result = mysql_query( " SELECT FLOOR(RAND() * COUNT(*)) AS `offset` FROM `video` "); $offset_row = mysql_fetch_object( $offset_result ); $offset = $offset_row->offset; $result3 = mysql_query( " SELECT * FROM `video` WHERE approve='1' and `show`='1' LIMIT $offset, 10 " );
  22. Oh yeah!! Thats it. Ive been searching for this for 7 years, how did you find it so quickly? Anyway now i know the title i can get it. Super Thanks!
  23. I saw a movie back in 1993 and i cant what it was, it must have been made between 1970 and 1993. Description: The plot revolves around the sun "super flaring" thus killing every living thing on earth - except those who actually died the moment the sun flared, there are three ppl 2 guys one gal they all eventually meet up through the course of the film. One of the guys discovers what happened and you see him observing the sun and trying to warn the other 2 who couldnt care less. Anyway in the end the sun is starting to flare again so he kills himself in a mack truck....thus surviving the flare at that instant. Thats all i can remember, ive been searching for ages for this. If you know this title - let me know and ill luv u long time
  24. Im trying to check if a file is a duplicate based on the md5 of the file, I have this so far but im not sure which way to go with it $file = $_FILES["file"]["name"]; $md_file = md5_file($file); $dir = getcwd(); if(file_exists($dir.$md_file){ echo "Image already exists. Please upload a different image."; }
  25. cookie or database session
×
×
  • 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.