Jump to content

WebStyles

Members
  • Posts

    1,216
  • Joined

  • Last visited

Everything posted by WebStyles

  1. your error said: c:\xamp means you're testing things on your local computer... not your webhost service. Chances are you will not need to modify anything. have you tried sending the email from your hosting account? (i.e. upload the script to your hosting account and run from there. What hosting do you have? linux, windows? - I'm guessing linux since you're programming in php)
  2. Is smtp.tools.sky.com a valid smtp server? did you try it? Try it.
  3. as the error says: you need to find out what your smtp server is, and add it to your php.ini file. if you're not sure, ask your ISP.
  4. no man, you don't want to download an smtp server... have you tried sending an email from your web server??? what was the error?
  5. There are standards for all country ids/codes, you should use that. There are also databases available with all country names and ids, that you can download. You'll find them on google.
  6. @AyKay47 you might be right, I'm not sure myself, but since he added "to allow people to contact me through my web form on my website.", I figure he doesn't really need one.
  7. you don't need to set up a mail server to let people send you messages through a form. All you need is and smtp server (which your ISP probably provides for you) and an email address.
  8. where does $file come from? don't you mean $_FILES ?
  9. just post here (I get an email every time you reply), and this way other people can help you too. the forum rules say:
  10. yes, it's always best to check first.
  11. yeah, "something" like that. (you have a typo: $_GET['iser'] should be user) // fetch users stuff: sql = mysql_query("SELECT * FROM `preference` WHERE `user` ='$user' LIMIT 1"); $result = mysql_fetch_assoc($sql); // store in session: $_SESSION['userPrefs'] = $result; // echo what you put in session just to be sure it's working as expected: echo '<pre>'; print_r($_SESSION['userPrefs']); echo '</pre>'; Since you're going to be grabbing these preferences on login, if a user changes his preferences, don't forget to also change them in $_SESSION['userPrefs'] or run this script again to replace them after any changes have been made.
  12. I would store the activation codes in a database, and also have a time limit on them (like if they're nor accessed within 30 minutes, they get disabled or deleted). .txt files seems insecure to me, since there are many downloaders out there that will easily download these files.
  13. yes. If you're planning on letting the users change their preferences, you will need to store those preferences somewhere so that they're available next time a user logs in. To keep things organized, I would create a new mysql table called `userPrefs` (or similar) and store all user preferences in there. Then, whenever they login, you can pull out all their preferences and store in a session variable.
  14. it really depends on what you are doing... I can imagine several different scenarios and I'm not sure which one you need: 1. Administrators get redirected to a different page (just check if user is admin and redirect) 2. Users can change their preferences to select their homepage (store selected page in database) 3. Accounts are about to expire, redirect to payment page (check expiry date and redirect) ... (I could go on and on...) What exactly is your situation?
  15. you mean how do you convert the int returned from time to a date format ? instead of time you can use date like this: date("Y-m-d H:i:s"); or you can convert your timestamp to a date format with: date("Y-m-d H:i:s",$mytimestamp); check out all the options on php.net by following this link: date
  16. there's nothing wrong with doing it through php, as you have, so I don't really want to waste your time too much on this. It's just a way of having things a little more automated so you don't have to script in a timestamp update every time you change stuff in the database. check out my print screen:
  17. do you mean this: (?) session_start(); $col = $_SESSION[$column]; $query = "SELECT $col FROM table"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_assoc($result)){ echo $row[$col] ; }
  18. Why 2 variables doing the same thing? $Timestamper=time(); $gettime=time(); Yes, you can create your timestamp in php and send it through, but all this can also be automatic: in phpmyadmin, change field type from datetime to timestamp, and set Default value to CURRENT_TIMESTAMP, and Attributes to on update CURRENT_TIMESTAMP now your timestamp will update automatically every time a new database entry is created or modified.
  19. try something like: <?php $file = file("suggested.txt"); $votes = array(); for($i=0;$i<count($file);$i++){ $exp = explode("|", $file[$i]); $votecount = trim($exp[1]); $votes[$exp[0]] = $votecount; } arsort($votes, SORT_NUMERIC); foreach ($votes as $country=>$vote){ print $country." ".$vote."<br>"; } ?>
  20. time will basically return the number of seconds that have passed since 1st Jan 1970. You can convert any timestamp into other date formats using date, but if all you want is to store the time of the operation in your database, you can also use a mysql timestamp (that will automatically update the field for you, no extra code needed.
  21. Sure it's possible, is this just for one single user, or would each user have his own landing page (in the second case you would need to store the page's name in the database associated with each user name.
  22. Do you mean you have several items in the `ingredients` field, and want to do a list from there? is that a text field with a bunch of items? like: tomatoes, carrots, salt, rice, peas... (Are they comma separated?) if they are (comma separated), all you need to do is explode that particular field and then create your list from the resulting array, or just replace the commas with a <br />: something like: (assuming $result is the var name to fetch items from database) $list = explode(",",$result['ingredients']); foreach($list as $ingredient){ echo $ingredient.'<br />'; } or even just: echo str_replace(",","<br />",$result['ingredients']); Hope this helps
  23. you're using: $_GET["idiom"] but in the url the variable is called 'locale'
  24. check your uploads folder permissions.
×
×
  • 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.