Jump to content

MatthewJ

Members
  • Posts

    803
  • Joined

  • Last visited

    Never

Everything posted by MatthewJ

  1. Um... no, he was stating that the whole row was printing when he only wanted the first fields data. Exactly why I suggested mysql_fetch_array as it returns an array accessible by numeric key.
  2. mysql_fetch_row... I think you mean mysql_fetch_array()?
  3. You can populate a mailto link... but I'm not sure why you would want to... it sounds like this is going to a single person to check for invitations being submitted? If so, then why not just tell outlook it isn't junk and move on? If that isn't an option, check that you are setting a From header. If it is omitted, it will send the email as the servernameofhost@someweirdomainname.com etc.
  4. Well, then they have to be separate paragraphs... again, text-indent indents the first line of a pragraph
  5. You use a margin or padding... text indent is supposed to do exactly what you're saying (indent the first line of the text like proper paragraph formatting calls for). In order to achieve what you're looking for, I would think you just need to split them into multiple paragraphs.
  6. $counter = 0; echo "<table>" do { $bgclass = ($counter % 2 == 0) ? 'color1' : 'color2'; //echo row and set the class equal to $bgclass echo "<tr class='$bgclass'><td>" . $row['databasefield'] . "</td></tr>"; $counter++; } while ($row = mysql_fetch_assoc()); echo "</table>"; Something like that maybe?
  7. Like Nuv said... missing bracket on the If. The unexpected $end on line whatever points to the problem being on the line directly above the referenced line number.
  8. Also, I would try the From: header as the email address only and remove it from the < > like the manual example.
  9. I had the same problem on a host a year or so ago... if I recall, I got it fixed by adding the php-version header to the mail headers. Almost like if it didn't know what php version was sending the mail, it defaulted. Example from the PHP manual <?php $to = 'nobody@example.com'; $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); ?> Maybe that will help?
  10. You can get decent hosting for < $5 a month... it may be time to just bite the bullet.
  11. You just need to get the contents of that file into a variable, and use the same content-header method to display it for print/save.
  12. http://www.freeopenbook.com/php-hacks/phphks-CHP-5-SECT-16.html
  13. if (isset($_POST["name"]) && $_POST["name"] != "") { //Do whatever } else { echo "Error!"; }
  14. Well, put them into an array and return the array Almost anything is better than setting them as global.
  15. Well, and to actually answer the question you asked... in this situation you could do something like <?php function function_1() { $variable_1 = "hello world"; return $variable_1; } function function_2($output) { echo $output; } $var1 = function_1(); // This will make $var1 equal to the value returned from function_1 function_2($var1); //This will "pass" the variable that now contains the result of function_1 to function_2 to be displayed ?> Hope that helps
  16. Use full open tags.. it will save you from headaches down the road. <?php } ?>
  17. Hmm, maybe put in a $_SESSION var a flag that video 1 has already been viewed... refresh the page, check for the flag, and display the appropriate vid based on the flag?
  18. It depends on how you mean... If you're looking to show a video randomly, sure, just put the video links into an array and pick a random element from it for linking in. If you want someone to see the first video until they have watched it, but then they only see the next video, etc. then you could set a cookie on their system with the id or name of the last vid they watched. Check that cookie when they get back, and load the next video instead.
  19. http://www.html-form-guide.com/php-form/php-form-submit.html
  20. if(time() <= strtotime("4/8/2011")) { echo "It is before 4/8/2011"; } else { echo "It is after 4/8/2011"; }
  21. Post the source code of the parsed page... And use code tags
  22. <html> <head> <title>Page Title</title> <style> .gray { backgroundcolor: gray; } .white { backgroundcolor: white; } </style> </head> <body> <?php $connection = mysql_connect("localhost", "username", "password"); mysql_select_db("articles", $connection); $query="SELECT * FROM articles WHERE id=1"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); ?> <table border="1" cellspacing="2" cellpadding="2"> <tr> <th><font face="Arial, Helvetica, sans-serif">Article</font></th> <th><font face="Arial, Helvetica, sans-serif">Year</font></th> <th><font face="Arial, Helvetica, sans-serif">Description</font></th> <th><font face="Arial, Helvetica, sans-serif">Location</font></th> </tr> <?php $i=0; while ($i < $num) { $backgroundclass = (($i % 2) == 0) ? 'gray' : 'white'; $f1=mysql_result($result,$i,"article"); $f2=mysql_result($result,$i,"year"); $f3=mysql_result($result,$i,"description"); $f4=mysql_result($result,$i,"location"); $f5=mysql_result($result,$i,"link") ?> <tr class='<?php echo $backgroundclass ?>'> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?></font></td> <td ><font face="Arial, Helvetica, sans-serif"><?php echo "<a href=\"$f5\" target=\"_blank\">$f4</a>"; ?></font></td> </tr> <tr> </tr> <?php $i++; } ?> </body> </html>
  23. You could do something like <?php $i=0; while ($i < $num) { $backgroundclass = (($i % 2) == 0) ? 'gray' : 'white'; $f1=mysql_result($result,$i,"article"); $f2=mysql_result($result,$i,"year"); $f3=mysql_result($result,$i,"description"); $f4=mysql_result($result,$i,"location"); $f5=mysql_result($result,$i,"link") ?> <tr class='<?php echo $backgroundclass ?>'> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?></font></td> <td ><font face="Arial, Helvetica, sans-serif"><?php echo "<a href=\"$f5\" target=\"_blank\">$f4</a>"; ?></font></td> </tr> <tr> </tr> Then just create css classes called gray and white and have them set the color appropriately.
×
×
  • 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.