Jump to content

poirot

Members
  • Posts

    646
  • Joined

  • Last visited

    Never

Everything posted by poirot

  1. 1. Where is the part of the code which actually inserts an entry into the database? 2. Have you tried using var_dump()? ie: var_dump($_POST)
  2. How is the HTML code with the checkboxes anyways? Remember that you need to send it as an array to ensure PHP can get all your selections. Then you can use a loop (like foreach) to work with the items and insert them into the database.
  3. Your HTML is wrong; the empName stuff is out of the form that is being sent. Plus, there are only 2 variables being sent to taskAdminQuery.php; which are $_GET['empName'] and $_GET['taskID']. You need to use arrays in the forms (that's HTML) to send more than 1 taskID and empName. If I can recall, something like this: <select name="empID[]"> should work. Then use a loop (like foreach) in PHP to work with the submitted array. By the way, use POST instead of GET.
  4. Try to add this into each page: echo '<pre>'; print_r($_SESSION); echo '</pre>'; To check if the session is being passed correctly.
  5. What is actually your problem? Are you trying to insert or update something into the database or are you trying to output data from the DB?
  6. Apparently connection to the DB is failing. Try this: http://dev.mysql.com/doc/refman/5.0/en/can-not-connect-to-server.html
  7. Does it post at all? Meaning, does it redirect to the targeted page (index.php) after the click? If it doesn't, you might want to check your HTML.
  8. I don't know if you can "direct" an email to a PHP script, but you can have PHP to handle the emails sent to a certain address, although I believe this is very low level and you might have to do a lot of work... Look at the PHP IMAP functions as they might serve your purpose http://www.php.net/imap
  9. You might as well use iframes and javascript - so you don't need to redirect to a new page. It depends on what you want to do...
  10. There is probably something wrong with the code and it is outputting some kind of error and it is messing the HTML. You should try to actually see the generated source code to have a better idea, but I guess the problem lies in using uniqid() without prefix, as this works only with PHP >=5 . http://www.php.net/uniqid
  11. To do what you are trying to you would need Regular Expressions or similar methods, so I recommend you just to wrap it using HTML/CSS.
  12. Replace this: "$siteurl/validate.php?vc=$valid\n\n". With "<a href=\"$siteurl/validate.php?vc=$valid\">Click here</a>\n\n".
  13. There's a error in there, if (isset($_COOKIE['cegl_autologin'])) { $username = $_POST['cegl_username']; $password = $_POST['cegl_password']; The $_POST stuff will be empty, because it was not POST'd. You might want to access the $_COOKIE['cegl_username'] and password - although I don't recommend storing password in cookie files.
  14. Basically whenever you need to get something from a URL use $_GET, the POST method is something else and has nothing to do with the URL.
  15. What are you trying to connect to? What functions you are using? Just a tip, some servers disable fsockopen() and similar functions.
  16. There are some strange things in your code, but based on a quick look over it, this might work: REPLACE this line <?php while($row['Name'] = mssql_fetch_array($SQL)) WITH <?php while($row = mssql_fetch_array($SQL)) Also make sure your query actually returns valid rows.
  17. Then there is probably something wrong with other parts of the code. Try to print the query before actually querying - see if it is what was supposed to be, it might shed some light on what is the problem.
  18. This might be what you were looking for: $test = array(); for($i=0; $i<=1; $i+=0.1) { $test[] = $i; // Change this line here; } foreach($test as $item) { if($item == 1) // Here { die("Yeah"); } else { echo $item . " "; // And here } }
  19. Just correcting what might have been typos http://www.php.net/ImageString http://www.php.net/imagettftext And remember you need to have FreeType library installed for imagettftext() to work correctly.
  20. Ken meant to replace your double quotes with single quotes. It might work - as it seems like PHP is somehow replacing '&' with the HTML entity.
  21. You can use the built-in function basename() to strip the directories http://www.php.net/basename
  22. What happens when you try to run that piece of code? Oh, this: $query_rsClassified = sprintf("SELECT * FROM classified_ads WHERE enddate_cla > %s ORDER BY ID_cla DESC", $coldate_rsClassified); could be replaced with: $query_rsClassified = "\"SELECT * FROM classified_ads WHERE enddate_cla > $coldate_rsClassified ORDER BY ID_cla DESC\"";
  23. Are you sure the session data itself is being destroyed prematurely? Since you are using files to store them, you can know this by looking at the session folder (session.save_path) and check if the file is still there. The session file is named after the session id. Likely, the session data is not being destroyed, but the session id not being propagated correctly. You can check that by printing the session_id on every page, if you notice that it changes, you have a problem with propagation. And also it may be a browser related bug; check it with Mozilla Firefox and if it works correctly, you should add the following header: [code=php:0]header("Cache-control: private");[/code]
  24. If you are getting an error like "Warning: Cannot modify header information - headers already sent by" read wildteen's post
×
×
  • 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.