Jump to content

taquitosensei

Members
  • Posts

    676
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by taquitosensei

  1. view the source in your browser make sure there's no unexpected output and that the classes/ids actually match what's in your css.
  2. something like this $glue=""; foreach($yourarray as $item) { print($glue."[". $current_month .",". number_format($remaining_balance, "2", ".", ",") . "]"); $glue=","; }
  3. $days=ceil(strtotime($future_timestamp)-strtotime(date("Y-m-d"))/86400)
  4. also if you're looking for the last inserted id I would use this select last_insert_id() as lastid from table limit 1 that actually gets the id of the last row inserted by the current connection. This saves you headaches further down the road if you get more than one connection putting data into your database.
  5. also if you're going to have more than one character it would look like this. $characters = array ( array ( "name"=>"Joe", "occupation"=>"Programmer", "age"=>30, "Learned language "=>"Java" ) ); foreach($characters as $character) { echo $character['name']; }
  6. array_rand(); $product_1 = '<h2>Test Product 1</h2><p>skdug sdkhg ks dkghjs kjsd jhfs dfklj</p><img src="images/test/test1.gif" align="left" height="50" width="50" border="0" />'; $product_2 = '<h2>Test Product 2</h2><p>skdug sdkhg ks dkghjs kjsd jhfs dfklj</p><img src="images/test/test2.gif" align="left" height="50" width="50" border="0" />'; $product_3 = '<h2>Test Product 3</h2><p>skdug sdkhg ks dkghjs kjsd jhfs dfklj</p><img src="images/test/test3.gif" align="left" height="50" width="50" border="0" />'; $products = array($product_1, $product_2, $product_3); $rand_products=array_rand($products,3); // this gives you an array with your 3 random elements
  7. it sounds like magic_quotes_gpc is on try turning it off in .htaccess with "php_flag magic_quotes_gpc off" or you can stripslashes($string) on your output
  8. You can't with php because php is server side so it can't see the local lan for your client. You may be able to with javascript.
  9. I'm pretty sure its as easy as. session_start("yourcustomsessionname"); then just use that to start the session at the top of each page that will use it.
  10. not without using ajax to send to the server then redirect to your next page. At that point you might as well just submit the form. Since you're going to another page anyways.
  11. Yes it is. Take a look at. http://pear.php.net/package/Net_POP3/
  12. It's probably because your using tables and your echo is not in the table structure. Just lay out your table structure so it includes your echo.
  13. as best as I can tell $age=520; $remainder=$age%50; // % gets the remainder of division $amount=floor($age/50); // divide by 50 then round down. Gets the number of times 50 goes in to the age. // loop for each time 50 goes into $age for($a=0;$a<$amount;$a++) { // send 50 to your site } // send remainder to your site
  14. I think you're in the wrong forum. This looks like a variant of ASP. Definitely not PHP. PHP opening and closing tags would be <?php ?>
  15. It's combining your 2 queries. It's selecting everything from comments and users where the name in comments = the name in users and Comments.id=$t let's say I have this table structure Comments comments name id Hi long time lurker, first time poster tom 1 Am I the only on here? tom 2 Users name id tom 1 This query select * from Comments JOIN Users on Comments.Name=Users.Name where Comments.id=1 would give you Comments.comment Hi long time lurker, first time poster Comments.name tom Comments.id 1 Users.name tom Users.id 1
  16. it would kind of work. Something like this would work better. <?php $result4 = mysql_query("SELECT * FROM comments JOIN Users on Comments.Name=Users.NameWHERE Comments.id=$t"); while($row = mysql_fetch_assoc($result4)); { $to = $row['email']; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); } ?>
  17. use mysql_fetch_assoc instead. mysql_fetch_row returns a numerically indexed array. mysql_fetch_assoc returns an associative array.
  18. first thing I noticed $num = mssql_num_rows($rs); if ( $num !=0 ) { if (mssql_num_rows($rs)) { could be shortened to if(mssql_num_rows($rs)!=0) {
  19. if this $sql = "SELECT * FROM inbox WHERE product_id = '".$_GET['id']."' AND from != 'admin'"; works Then so should this $sql = "SELECT * FROM inbox WHERE product_id = '".$_GET['id']."'";
  20. this should work $bigstring = "automobile"; $littlestring = "mobile"; if( !strpos($bigstring, $littlestring) ) { // Do something } you had an extra "("
  21. It's a line break for a text file. "\r\n" would cover unix and windows.
  22. This should do it. echo date("Y-m-d", strtotime($_GET['search'],"+1 Days"));
×
×
  • 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.