Jump to content

ober

Staff Alumni
  • Posts

    5,327
  • Joined

  • Last visited

Everything posted by ober

  1. Chances are they're not using PHP to do that. They're firing off some system-based software that builds the report for you.
  2. [code] for($i=0;$i<count($myarray);$i++) {     if(strlen($myarray[$i]) == 1)        $myarray[$i] = "0" . $myarray[$i]; } [/code]
  3. Well you would just create a file and write out to it then... I'm not sure why you'd want to do that, but that's up to you.
  4. I think you're confused or I'm not catching on to what you're trying to do. I assume "getuserinfo()" is always going to have the same output.... so you would put the echos and whatnot in the class as well. Keep in mind that calls to functions in a class can work somewhat like a more powerful include(). When you call the $cn->GetUserInfo() and you have your while loop and echos in the class, it will display all that information for you. You don't have to return it or anything like that.
  5. That's correct in most cases, but why should your user have to hit the back button??? You should be doing that for them. And at least for IE, you'll often get "Page Expired" errors when you try to go back to a form like that.
  6. You would generate the HTML the same as you would generate the page on your website, except that you put all the HTML code into a variable which gets passed on to the mail() call as the body.
  7. That only works if that 2nd page is pre-defined... your solution fails if you plan to put this in place throughout a website.
  8. The proper way to do it is to have your validation code on the same page as the form. When the user submits the form it refers back to the same page and if the form results are invalid, you show the form again and the values are already there in the POST/GET. But you do all the validation before any HTML so if the validation is correct, you send the user onto a "thank you" page with the header() call. You can do the mailing after the validation or on the thank you page, it doesn't matter which one.
  9. So is the question answered?
  10. There is no function in PHP that will allow you to go back twice. The only way to do that would be to store a history in a cookie or in a session and then pull that out and stick it in header(Location:...)
  11. And that's exactly what you should be getting. All you've done is create the object and run the constructor. You need to do something like this: [code]$cn = new MySQLConnect(); $cn->GetUserInfo();[/code] But that's not going to output anything either, because you don't actually spit out your results, unless you're not showing us everything.
  12. [code]$query = "SELECT * FROM sample"; $result = mysql_query($query) or die(mysql_error()); if($result && mysql_num_rows($result) > 0) {      while($row = mysql_fetch_array($result))      {           extract($row);           echo "$field_a<br />";           echo "$field_b<br />";           // etc      } }[/code]
  13. Are the hits stored in the same table? SELECT * FROM table XYZ order by hits
  14. Since you are using an array for the names, you can do something like this in your processing page: [code] foreach($_REQUEST['record'] as $key) {     $query = "UPDATE table SET boolean_field = 1 WHERE ID = $key";     // run query and whatever else } [/code]
  15. Are you deleting the record or just removing it from the display? If you're deleting the record from the database, you don't need an extra field. If you're just removing it from the display, all you need is an enum field that can be either 1 or 0. Keep in mind that when you submit a form with checkboxes, only the ones that are checked will be passed on.
  16. If you're using the default PHPBB registration process, you'll have to modify their code. Either that, or you could just as easily use the PHPBB users table as the same users table for the main page.
  17. Well, I just noticed something else. He is sending an associative array to extract (that's what $row is), but there is a $ before the extract. Remove the $. extract() is a function, not a variable.
  18. Welcome to the forums. Your question is not a result of PHP. Layout issues concern HTML or CSS. I will move this to the CSS board.
  19. You can certainly make calls to a web application without a browser, but I'm not aware of a way to do it with PHP that doesn't involve a browser unless you use the compiled version of PHP. I'd personally suggest using another system-based piece of software that has the ability to send headers to do the job.
  20. You can't do this strictly with JavaScript or PHP. You have to combine them with AJAX or you need to reload the page with the location JS call.
  21. Remove all of this: [code]$postdate=mysql_result($result,$i,"postdate"); $title=mysql_result($result,$i,"title"); $newstextshort=mysql_result($result,$i,"newstextshort"); $newstextlong=mysql_result($result,$i,"newstextlong"); $source=mysql_result($result,$i,"source"); $sourcehyperlink=mysql_result($result,$i, "sourcehyperlink"); $category=mysql_result($result,$i,"category");[/code] The extract() does all of that for you within the while loop. I'm not sure why you're not getting the rest of the results however. The rest of that looks fine. I will mention, however, that your HTML is totally hosed. You should never use a DIV to align text within a <td> and the <font> tag is depreciated. You should really look into CSS or at least use inline CSS with the "style" attribute of the <td>.
  22. I actually think the gradiant isn't bad. It's better than plain black, you have to give him that. And Jeff, I'm not sure who you're hosted through (I think you host yourself, so whatever), but I don't know of a single host that claims 100% uptime. That's NEVER going to be true. If I ever saw a host that claimed 100% uptime, I wouldn't go with them because they're bunch of goddamn liars.
  23. Try this: [code]foreach ($_FILES["PHOTOONE"] as $key => $error)             {    if ($error == UPLOAD_ERR_OK) {        $tmp_name = $_FILES["PHOTOONE"]["tmp_name"][$key];        $name = $_FILES["PHOTOONE"]["name"][$key];        move_uploaded_file($tmp_name, "$ImagePath/".$_POST['PHOTOREF']."-$name"); $PHOTOONE = "".$_POST['PHOTOREF']."-$name";                                 }             }[/code]
  24. The changes have helped tremendously, but I have the same complaints as a few others. The seperator on the index needs to be a shade lighter and if it's not going to touch the sides, it shouldn't touch the top and bottom. You also need more padding, mainly on the right side. The black is a pretty good change, but it'd look better as a gradient instead of a solid color.
×
×
  • 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.