Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

3 Neutral

About Lulzim

  • Rank
  • Birthday March 1

Contact Methods

  • Website URL
  • ICQ

Profile Information

  • Location
  • Interests
    Web Programming
  1. even though your user has no password you have to specify the user. mysqldump -u root database_name > e:/sql/alpha2.sql try running the command on command line first to see if you get the desired result and then put int on php script and if you are on windows, you might have to include the full path to mysqldump (something like "c:program filesmysqlbinmysqldump.exe -u root database_name > e:/sql/alpha2.sql")
  2. Lulzim

    Need Help Here..

    You just had to make a few small changes: <?php$dateFromDb = new DateTime($replace_this_with_your_date_from_db); #don't forget to fix this line$currentDate = new DateTime();$difference = $currentDate->diff($dateFromDb);if($difference->m>=1){ echo "1 month has passed please register.";}else { echo "Carry on"; }
  3. Lulzim

    Need Help Here..

    Something like this? $dateFromDb = new DateTime('2013-08-16 10:55:14');$currentDate = new DateTime();$difference = $currentDate->diff($dateFromDb);if($difference->m>=1){ echo "years: ".$difference->y."<br />"; echo "months: ".$difference->m."<br />"; echo "days: ".$difference->d."<br />"; echo "hours: ".$difference->h."<br />"; echo "minutes: ".$difference->i."<br />"; echo "seconds: ".$difference->s."<br />";}
  4. Get the required information from a form, then generate php code and save it to a file. Something like this in your case: <?php$string = '<?php $db_host = "'. $_POST["db_host"]. '";$db_uname = "'. $_POST["db_uname"]. '";$db_pass = "'. $_POST["db_pass"]. '";$db_name = "'. $_POST["db_name"]. '";?>';$file = fopen("config.php", "w");fwrite($file, $string);fclose($file);?>
  5. The difference Include_once and include (same as require_once and require) is that *_once will check if the file was included/required before, it will not include it again. And the difference between include and require is that require will stop the execution of the script if it cannot find the file required and generate a fatal error. While include will only issue a warning and continue the execution of the script. So for essential code, as in this case DB connection, require_once is best.
  6. Yeah, try to look at error_log if you don't set display errors as thescientist suggested. Here are a few errors you have: Notice: Undefined variable: nameپست in ... Meaning if you are going to put a variable inside a string, concatenate it or enclose on {}Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in ... The email you typed "info@keivanstone.ir <>" is not a vaild email. Remove <> or format it properly. Also, change this line $_SESSION['captcha'] = $num . $num2; to $_SESSION['captcha'] = $num+$num2; because it is
  7. Just FYI, the way you are constructing the query is very dangerous. Read through this page so you can see what can happen and how to protect it http://php.net/manual/en/security.database.sql-injection.php
  8. I tested your script and here is what I found: -You need to use session_start() if you are going to use sessions. That is why $captcha != $_SESSION['captcha'] will always fail. -About the captcha, did you mean to add the two numbers and enter the result on the text box, or just concatenate them? Because as it is right now, if you add them, lets say you get 24 + 10 and you enter 34 it will not work. As it is right now, for that example you should write 2410. Here is the complete code that worked for me <?phpsession_start(); #was missingini_set("display_errors",1); #remove this on p
  9. take a look at these lines: else { echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="eng"> If you start a string with double quotes " the string will end when the next double quote occurs.Now, on this line the string starts and ends on the quotes marked on red. The rest of the line is considered a comment because of //echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitiona
  10. Lulzim

    Single Result

    It is not very clear what are you looking forif you want to get distinctive results from one column the sql query should look something like this SELECT DISTINCT column_name FROM table_NAME if you want to get first three records from a table no matter what they are SELECT column_name FROM table_name LIMIT 0,3 hope that helps
  11. Lulzim

    Join Avi.x Files

    on linux there is a cli program called lxsplit, as for windows the only one I know is hjsplit
  12. sorting column and order should not be enclosed on quotes$result = mysql_query("SELECT * FROM reviews ORDER BY '$sort_by' '$ascordesc' LIMIT 0, 20");Also, I must say that this script is not secure at all. Do not use $_REQUEST, use $_POST or $_GET and check your data before inserting them on sql queries.
  13. <?php $a['beans'] = 1; $names = array_keys($a); echo $names[0]; ?>
  14. Just click the office button on upper left corner -> save as -> other formats -> then select the image format (png for example). After that it will ask which slides you want to export (current or all). Once you have the images then just include on your web pagehttp://library.wustl.edu/units/arc/dbb.html
  15. Your select box should look something like this: echo "<select name='color'>"; while ($baris3 = mysql_fetch_array($hasil3)) { $reff=$baris3["color"]; if($_POST['color'] == $reff) echo "<option value='$color' selected='selected' >$color</option>"; else echo "<option value='$color'>$color</option>"; } echo "</select>"; I'm not sure I used the right variables in the right place but that's the logic basically.
  • Create New...