Jump to content

greatstar00

Members
  • Posts

    154
  • Joined

  • Last visited

    Never

Everything posted by greatstar00

  1. do u mind tell us what is public_html/xxx.php (the xxx)? and post code in that xxx (represented) file
  2. so, did u tried to echo $query and see what it has?
  3. this is how a bitwise operator works consider a value , 3, in binary code, it is 00000011 and another value, 4, in vunary code, it is 00000100 if 3 & 4, then returns 0 00000011 00000100 you do the and by each bit for example, the right most bit, 1 (from 3), and 0 ( from 4), it is 0 2nd right most bit, 1 from 3, 0 from 4 is 0 3rd right most bit, 0 from 3, 1 from 4, is 0 and the rest is 0 too
  4. $pages=1; $do=''; while($pages <= $numberofpages){ if($pages==0){ $do .= '<a href="allnews.php"><< First</a> '; } else if($pages==$numberofpages){ $do .= '<a href="allnews.php?&page='.$new.'">Last >></a> '; }else{ $new = $pages; if($_GET['page']==$pages){ $do .= '<a href="allnews.php?&page='.$new.'"><font color="red">['.$pages.']</font></a>'; } else { $do .= '<a href="allnews.php?&page='.$new.'">['.$pages.']</a> '; } } $pages ++; }
  5. change $new = $pages++; to $new = $pages+1; because the one u got, it will increment $pages as well it is like this, for the one u have $new=$pages=$pages+1
  6. and your javascript code is very messy hard to read!!!
  7. does your server support cron job?
  8. on ie, when i open it as in a new windows, it works but when i just refresh it in the same window, it doesnt work so, show us the javascript
  9. add nl2br this function is called new line to break br = <br /> because html sucks, they dont show newline character, even u have in code\ they only show <br /> as new line
  10. i am sorry, i didnt check the syntact too (time() - strtotime($timeposted)) > 86400*7
  11. suppose your link is like this http://sample.com/?movie=Macbeth u can use extract this is your code would be $newarr[$_GET['movie']]=""; extract($newarr); //now, u have $Macbeth //then u can re-assign new value $Macbeth=array();
  12. <?php include 'config.php'; $query = mysql_query("SELECT * FROM News ORDER BY Posted DESC") or trigger_error('Query failed: '. mysql_error()); $totalrows = mysql_num_rows($query); $numberofpages = ceil($totalrows / '10'); if(isset($_GET['page'])) { $currentpage = $_GET['page'] * 10; } else { $currentpage = 0; }; $query2 = mysql_query("SELECT * FROM News ORDER BY Posted DESC LIMIT $currentpage, 10 ") or trigger_error('Query failed: '. mysql_error()); $pages=0; $do=''; while($pages < $numberofpages) { if($pages==0){$do .= '<a href="allnews.php"><< First</a> '; }else if($pages==$numberofpages-1){ $do .= '<a href="allnews.php?page='.$new.'">Last>></a> '; } else{ $new = $pages++; if($_GET['page']==$pages){ $do .= '<a href="allnews.php?&page='.$new.'"><font color="red">['.$pages.']</font></a> '; }else{ $do .= '<a href="allnews.php?&page='.$new.'">['.$pages.']</a> '; } }; $pages ++; } while($row = mysql_fetch_array($query2)) { echo '<h4 style="margin:0px; font-size:12px;">'. $row['Artname'] .'</h4>'; echo '<h4 style="margin:0px; font-size:11px;">'. $row['Posted'] .'</h4>'; echo '<p style="margin:0px;">'. $row['Article'] .'</p><br />'; } echo $do; ?> //so, add the similar stuff to <<first, and Last>>, see the middle pages as reference
  13. so,what is in index.php it must be blank if it isnt blank, it will show something if the page isnt found it will show 404 not found message
  14. (NOW() - unix_timestamp($timeposted)) > 86400*7 //86400 = second in a day
  15. u can combine your mysql session, and cron job but your need to change your code a bit
  16. so, just remove any echo, print_r, var_dump, print, flush() etc, all these code before line header()
  17. How can I get each site to use the same PHPSID? How does each site know what SID to use? u can use a random generator rand a number from 1 to 1000000, concatenate it with the micro time in unix stamp for example, it is now 1234567890, today, NOV 20, 20:00PM, just say as example, not real the microtime is 1234567890.123 meaning NOV 20, 20:00:00PM at micro second 123 then multiply this by 1k, so u get 1234567890123 and if you generated this number, 12389781 so, concatenate them 123456789012312389781 << this is your new phpSID
  18. connect to 1 database from all domains u have for example sample1.com connect to database 123.123.123.123 sample2.com connect to database 123.123.123.123 sample3.com connect to database 123.123.123.123 database 123.123.123.123 has the following table user_session phpSID hyperlink sample1.com?phpsid=31790AF sample2.com?phpsid=31790AF sample3.com?phpsid=31790AF where 31790AF, you generate this number, better not use the one php generated
  19. ob_start() is to turn on output buffering when the php process, whever it meet echo, it just save all the data into memory (or a temperary file, i am not sure) instead just send to the user on that line of code Header() when every internet request, the server will send an header to the client, telling all the information that the browers will send, like what kind of file, and stuff, as it said, header, it must be send to the client first, before anything. ob_flush() is to flush (send) all buffered data, send all the buffered data (those stored in memory) to the user why it fix the header in the middle: because you didnt send anything to the client yet, and header wont be buffered, and it is send once the php engine meet this line.
  20. if your term_id is same for all, u can use insert select insert tbl_term_relationships select the_ID, 31797411 as term_id from tbl_posts where guid like '%timalerts%'
  21. if you want to test things out use the server in my signature, it is free to everyone
  22. if you dont have cron job, the worst part is have this script include in all pages and check the last executed time, use the current subtract it if it is greater than 3600 seconds, then u execute that specific script
  23. Can anyone rate my website. I really wanted to know how much score will guys give me. So my future customers will be more statisfy. http://bbs.zkse.com and my homepage http://zkse.com Please rate this, Thank you very much.
×
×
  • 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.