Jump to content

snapper64

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

snapper64's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Anyone ? Please help, i desperately need to get this sorted ASAP . . .
  2. Hi Guys, I need to display the weather in orlando on my site. I have found this feed http://rss.weather.com/weather/rss/local/USFL0372?cm_ven=LWO&cm_cat=rss&par=LWO_rss which seems fine. I have downloaded RSS2PHP from http://www.feedforall.com/more-php.htm and have run the script with the above feed. My problem is that there is lots of unecessary info produced. I just need the bit that produces an applicable image, a description and the temperature (e.g. pic_of_sun, Sunny, and 89 ° F). How would i go about doing this? Is there a better script more suited to my needs out there? Also, is there a better rss feed i could use that only has the data i need ? Thanks, Charlie
  3. Hi Guys, I need to create a script that logs me in to http://tracks.tra.in/login. So i visit www.mydomain.com/tracks.php, it logs me in using the data stored in the php file and then sends me to http://tracks.tra.in/. I have got this so far: [code]<?php $cookieJar = \\\\\\\"cookie\\\\\\\"; //this should be set to whatever file on the computer you want to save and retrieve cookies to/from $userAgent = \\\\\\\"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5\\\\\\\"; $postData = \\\\\\\"user_login=gwbush&user_password=password\\\\\\\"; $url_login = \\\\\\\"http://tracks.tra.in/login\\\\\\\"; $url_view  = \\\\\\\'http://tracks.tra.in/\\\\\\\'; $ch = curl_init(); //creates and initializes a curl session curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieJar); //sets the file to save cookies in after recieving them from the page curl_setopt($ch, CURLOPT_COOKIEFILE, $cookieJar); //sets file to take cookies from to give to the site if needed curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); //sets the user agent string to make it look like this is a real browser curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); //if a simple http redirect is recieved, setting this to 1 will cause curl to follow the url curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //this causes the data retrieved to be returned by the curl_exec function below instead of being printed curl_setopt($ch, CURLOPT_URL, $url_login); //sets the url to request curl_setopt($ch, CURLOPT_POST, 1); //this is a post request and not a get request like normal curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); //the post data to be sent with the request $data = curl_exec ($ch); //execute the request curl_close ($ch); //close the curl session unset($ch); //destroy the curl session. $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookieJar); curl_setopt($ch, CURLOPT_URL, $url_view); $result = curl_exec ($ch); curl_close ($ch); echo $result; ?>[/code] My problem is when i execute this script it logs me in but shows the http://tracks.tra.in/ home page on my domain (www.mysite.com/tracks.php shows http://tracks.tra.in/). Once the script has logged me in i need to be redirected to that site but still stay logged in. Please help . . . Thanks, Charlie
  4. Thanks for the quick reply. I absolutely hate frames, however they are the best option in these circumstances.
  5. Hi Guys, I need to prevent index.php being accessed directly ie [a href=\"http://www.mydomain.com/index.php\" target=\"_blank\"]http://www.mydomain.com/index.php[/a]. People should only be able to access it when they are viewing [a href=\"http://www.mydomain.com/main.html\" target=\"_blank\"]http://www.mydomain.com/main.html[/a] - this page has 4 frames, index.php is the main one. I only want people to view index.php through main.html. Is this possible ? Also if they try viewing it directly they need to be redirected to main.html. How would i go about this ? Thanks, Charlie
  6. You can use a file called robots.txt, just place it in your sites main directory. An example of a robots.txt is: [code] # Webcrawlers control # Prevent Google from indexing pages User-agent: googlebot Disallow: / [/code] If you search on google for robots.txt you will find a load of info . . . Hope this helps, Charlie
  7. Hi Guys, I am unfortunately having to post on here for help again !!!! Basically i have been followng this tutorial: [a href=\"http://www.olate.com/articles/185\" target=\"_blank\"]http://www.olate.com/articles/185[/a] and have then gone onto this: [a href=\"http://www.olate.co.uk/articles/232\" target=\"_blank\"]http://www.olate.co.uk/articles/232[/a] Everything works up to the point when md5 is supposed to decrypt the hash string in the activation url (im not too certain about this). Its producing the wrong result. Is it even possible to do this ? My mysql database has a users table which has the following fields: userid title forename surname password address phone email salt timestamp status Basically i need to compare the decrypted hash string to the encrypted password stored in the database. If you read the tutorial i linked above this will probably make sense [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /] My activate.php looks like this: [code]<?php // Include init file include "init.php"; $md5 = md5($_GET['hash']); $base = base64_decode($_GET['stamp']); $sql = "UPDATE users SET status='1' WHERE timestamp='$base' limit 1"; // And lastly, store the information in the database mysql_query ($sql) or die(mysql_error()); printf("Records changed: %d\n", mysql_affected_rows()); ?>[/code] The account i am trying to activate is called 'test' with a pasword of 'test1234' (obviously without the ''). Let me know if you need anymore info guys and i will provide it [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /] Thanks, Charlie
  8. Works perfectly. Thanks a million, Charlie
  9. Hi, I have created an activation script for my registration script. It will eventually work by getting the encrypted password and timestamp from the URL. However because i ran into problems i commented out this section and just entered exact values(the same as those entered in the database, but its still failing !!! [code]<?php // Include init file include 'init.php'; //$md5 = md5($_GET['hash']); //$base = base64_decode($_GET['stamp']); $sql = 'UPDATE `users`'         . ' SET `status` = `0`' //              . ' WHERE `password` = `$md5` AND `timestamp` = `$base`';               . ' WHERE `password` = `0b78601ab862c0c13becef26327f4f9c` AND `timestamp` = `1149021727`'; // And lastly, store the information in the database mysql_query ($sql) or die(mysql_error()); // ?>[/code] I get this error when i run the script: 'Unknown column '0b78601ab862c0c13becef26327f4f9c' in 'where clause' Any ideas ? Thanks, Charlie
  10. It works. Thanks for the speedy reply !
  11. Hi Guys, I have got a problem and i cant figure out why. Basically i have created a page that will connect to a database and modify the information within it. You can see my file below: [code]<?php // Include init file include 'init.php'; $md5 = md5($_GET['hash']); $base = base64_decode($_GET['stamp']); $sql = 'UPDATE `users`'         . ' SET `status` = `1`         . ' WHERE `password` = `$md5`' AND `timestamp` = `$base`; // And lastly, store the information in the database mysql_query ($sql) or die ('Activation Failed'); ?>[/code]Unfortunately it is throwing up this error: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Parse error: syntax error, unexpected T_STRING in /path/to/my/file.php on line 11[/quote] Any ideas??? Thanks, Charlie
  12. Hi Guys, I am wanting to create a script that allows certain data to be submitted and then sent to an email account. This email must contain a validation link that can be clicked to confim the submitted data is correct and then to display it on the web. I assume this is the same principle as the user validation emails that are sent when you register on forums, however i am unsure of how to do this . . . Any help will be greatly appreciated, Charlie
×
×
  • 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.