Jump to content

Rayhan Muktader

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Everything posted by Rayhan Muktader

  1. Hey, Fix your spelling: echo $row['firstame'] 'firstname'
  2. No 54 tables cannot be called "a lot". If you are worried about load time then you should query and join using primary keys.
  3. mjdamato is suggesting that you don't push any one down. That would be a lot of extra work. Instead, save the id, name and button_pushed_time_stamp (you should rename this one) in the database. example: 1 Tom 2011-01-10 2 Dick 2011-01-09 3 Harry 2011-01-08 If Harry pushes the button again on the 11th then the table will hold: 1 Tom 2011-01-10 2 Dick 2011-01-09 3 Harry 2011-01-11 Then you can you can always order the data by who pushed the button last: SELECT * FORM `table` ORDER BY `button_pushed_time_stamp` DESC This will return: 3 Harry 2011-01-11 1 Tom 2011-01-10 2 Dick 2011-01-09 Hope this helps. Rayhan Muktader
  4. Hey, if (is_numeric($lines[$i][$j]) should return false because $lines[$i][$j] should contain an array. I Hope that helps. And yes, group is a reserved mysql keyword. You might want to rename that field to make your life easier. Rayhan Muktader
  5. When you "use a hash" do mean to say that I should use a form key? I do not understand the part about reloading the page. How would that work? Could you kindly explain?
  6. Doing the following should make the cookie available to all directories under / and force the cookie to expire after two hours. setcookie("loggedin",$value, time()+3600*2,"/");
  7. The session name is reset to the default value stored in session.name at request startup time. Thus, you need to call session_name() for every request (and before session_start() or session_register() are called).
  8. Sorry, I want to clarify one thing. I am not 100% that it is IIS. But according to php info() php is running on WinNT and no information about apache is mentioned. I am assuming that it is IIS. Is there a way to find out for sure?
  9. Hello, I can't seem to ftp into IIS using fire ftp or other freebies. The only thing that works is DreamWeaver. Did anyone else ever have this problem? Does MS use some special protocol? NOTE: Linux command line worked but it's too tedious to upload one file at a time. I don't this matters but the site was originally built DreamWeaver.
  10. Hmm... file_exists() been around since php4. What version are you using?
  11. Your . may not be getting evaluated. Try this and see if it works. <?php $p = mysqli_real_escape_string($mysqli,trim(strip_tags($_POST['password']))); $p = $p . STR_PWSALT; $sql = "SELECT username, f_name, l_name, password FROM employees WHERE username = '$checkuser' AND password = sha1('$checkpassword.STR_PWSALT') LIMIT 1"; $result = @mysqli_query($mysqli, $sql) or die(header("Location: error.html")); ?>
  12. "how does it work?" When you use output buffering, the result generated by php(usually html) is sent to a buffer (meaning saved in memory) instead of directly being sent to the browser. The saved material will wait in the buffer until you tell it go to the browser. The primary use for output buffering is header redirection. As you may know that a header resides at the very beginning of a html file and a html file can have only one header. Therefore, you can't do a header redirection in the middle of a page. But you can do this if you are using output buffering. Because the page goes to the buffer and does not get displayed by the browser(using the first header) first. The bad news is that output buffering taxes the server. And crappy servers will generate memory errors every now and then. Hope that makes thing clearer for you.
  13. Which error are you getting? The unexpected '<' error or the original error? Create a separate php file and do the following: <?php # FIRST CONNECT TO THE DATABASE # THEN $q = "select codename,id,height,weight,eyes,hair,ethnicity,characteristics,(YEAR(NOW()) - YEAR(dateofbirth)) - (MONTH(NOW()) < RIGHT(dateofbirth,5)) AS age, YEAR(NOW()) as thisYear from cerebra WHERE approved <> '' AND approved IS NOT NULL AND codename IS NOT NULL AND codename <> '' ORDER BY LENGTH(codename) DESC"; $theseChars2 = mysql_query($q,$db) or die(mysql_error()); ?> It is possible that all error reporting are off in the php settings and thats why you are not getting an error when your query is not executing correctly. But php does not have a choice about error reporting when fetcharray function gets an invalid parameter. Take care of one problem at a time. First make sure that this query executes correctly. And ask your server admin about command line access to mysql. It will make your life easier.
  14. And look into .htaccess if you want to protect your word docs from direct access.
  15. You said 'any' row. So I am assuming that want to send email to a single person. print out rows in the following way: # FIRST GET THE PERSON'S NAME AND EMAIL FROM THE DATABASE for (each row found in the database) { echo "<tr><a href=\"email.php?name=$name&email=$email\">$name</tr>"; } Then in the email script do something like: $name = $_GET['name']; $email = $_GET['email']; $message = "<html><body><p>Please Hello, how are you $name?</p></body></html>'; mail("$email", 'Hello', "$message", "To: $name <$email>\n" . "From: mysite <admin@mysite.com>\n" . "MIME-Version: 1.0\n" . "Content-type: text/html; charset=iso-8859-1");
  16. How do you know if the form displays output? Did you mean errors and warnings if invalid input is entered? Try putting this on the very top of the page: if(!isset($_POST['submit'])) { // first validate the form // then save the form in the database. if( form validates without errors) { header ("Location: http://" . $_SERVER['HTTP_HOST']); exit(); } }
  17. Run the query: "select codename,id,height,weight,eyes,hair,ethnicity,characteristics,(YEAR(NOW()) - YEAR(dateofbirth)) - (MONTH(NOW()) < RIGHT(dateofbirth,5)) AS age, YEAR(NOW()) as thisYear from cerebra WHERE approved <> '' AND approved IS NOT NULL AND codename IS NOT NULL AND codename <> '' ORDER BY LENGTH(codename) DESC" by itself from a command line and see if you get any error.
  18. Yeah, PhpDoc is almost identical to javadoc. You might also want to check out DocBook. You will have to create an xml file for your class but but it will give the more detailed options. I think you can even include inline comments in your document if you want.
  19. Whatever is easier for you is the best way.(Unless you create a security hole) I would create the forms in separate files like so: form1.inc.php, form2.inc.php. The form files should only contain a single form and nothing else. For example form1.inc.php should only have <form id="form1" method="post or get" action="whatever.php"> ..............</form> And in the page that displays these should check the database to see which form should be displayed and include that form like so: <Doctype and headers....> <body> <?php if(database says form1) { require_once("form1.inc.php"); } else { require_once("form2.inc.php"); } ?>
×
×
  • 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.