Jump to content

dadamssg87

Members
  • Posts

    218
  • Joined

  • Last visited

Everything posted by dadamssg87

  1. tried that..this is what it produced the image i'm looking for is here http://l.yimg.com/a/i/us/we/52/30.gif, but i would want to grab whatever image is there at the time. Like right now, it's a sun with a cloud in front of it.
  2. I'm not sure you can do this but i would like to grab the image gif from the rss feed of yahoo weather. For instance http://weather.yahooapis.com/forecastrss?p=77056 I pulled this script from a tutorial online and it works great for displaying the temperature and condition and i realize those values are located within the xml. But i would like to grab the image located between the <description> tags (if you look at the source of the rss feed). I don't know if this is possible or not. Thanks. <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Yahoo! Weather API RSS</title> <?php function retrieveYahooWeather($zipCode="92832") { $yahooUrl = "http://weather.yahooapis.com/forecastrss"; $yahooZip = "?p=$zipCode"; $yahooFullUrl = $yahooUrl . $yahooZip; $curlObject = curl_init(); curl_setopt($curlObject,CURLOPT_URL,$yahooFullUrl); curl_setopt($curlObject,CURLOPT_HEADER,false); curl_setopt($curlObject,CURLOPT_RETURNTRANSFER,true); $returnYahooWeather = curl_exec($curlObject); curl_close($curlObject); return $returnYahooWeather; } $localZipCode = "77056"; // Houston, Tx $weatherXmlString = retrieveYahooWeather($localZipCode); $weatherXmlObject = new SimpleXMLElement($weatherXmlString); $currentCondition = $weatherXmlObject->xpath("//yweather:condition"); $currentTemperature = $currentCondition[0]["temp"]; $currentDescription = $currentCondition[0]["text"]; ?> </head> <body> <h1>Houston, TX</h1> <ul> <li>Current Temperature: <?=$currentTemperature;?>°F</li> <li>Current Description: <?=$currentDescription;?></li> </ul> </body> </html>
  3. "man in the middle" as someone handling a transaction for a separate business, correct?
  4. I'm not sure i follow. You're suggestion here.. I plan on using CodeIgniter's MVC framework so i'm trying to figure out how to best use my directories. Would something like the following suffice? regular Http directory - Hold all CodeIgniter's normal files Secure Https directory - hold all images, css, javascript, The thing i'm concerned with is how to pass session variables(shopping cart contents) from the regular http directory to the secure https directory. I would assume that session wouldn't be valid in the https directory. And I would also probably have to copy all of the normal codeigniter framework into the https because every webpage from a MVC requires several files from several directories. Guess i would just be better off in just using the https directory... Also, I have cpanel on my hosting account and they look like they generate and provide SSL certificates free. These are the same as i would be buying from a 3rd party, right? Not sure what you mean by "real certificate". Thanks again.
  5. thanks for the tips. Good stuff to know. Hey Neil, i was under the impression that you just apply the SSL certificate to a certain directory and put all the files that handle the data you want secure in there. That doesn't seem to be the case if i shouldn't add non https links. I was thinking i would code the majority of the pages and files in a non-https directory and then once they've filled their shopping cart send them to the the checkout part which would be in the https directory. Am i completely wrong in thinking that i could do that? or should do that? or is the fact that i COULD do that but it would warn the user every time they'd switch from the normal to ssl certified directory?
  6. Oh ok....i just wanted to double check. I didn't want to code something like i normally would, install the certificate and the php act up. My understanding is that you have to apply to purchase an SSL certificate by inputting your business's information, get approved, and then somehow activate the certificate on your server. I've obviously never used it and can't seem to find any thing on the web that fully explains the process, from applying to implementing, and if it affects any of the server code, how much the things cost, and how long it generally takes to apply and implement it. If anyone has worked with SSL certificated could point me to a tutorial or walk me through the process i'd be greatly appreciative. Also, i realize this doesn't pertain to the PHP coding section now particularly, so if the admins would move the post that'd be cool too.
  7. I've been coding PHP for a while now and have never worked with e-commerce. Looking into start developing my own e-store. Payment gateways require your site to have SSL. Does SSL affect any of the PHP code? Why doesn't every PHP coded site have SSL if it protects your site? anything i should look out for? I'm not even sure how to implement the SSL but i want to get an idea of what i need to be prepared for. Thanks.
  8. you might also want to work in the Firefox browser and download the Web Developer add-on. You can pull up the css and edit it in real time. No editing a single aspect->saving->refreshing your page. It'd be more, edit-multiple-aspects->see-change-immediately then once you're happy with all that your done, save and refresh.
  9. I'm looking to build my own ecommerce site and i just looked at their sample code to test transactions. See below. <?php require_once 'anet_php_sdk/AuthorizeNet.php'; // Make sure this path is correct. $transaction = new AuthorizeNetAIM('YOUR_API_LOGIN_ID', 'YOUR_TRANSACTION_KEY'); $transaction->amount = '9.99'; $transaction->card_num = '4007000000027'; $transaction->exp_date = '10/16'; $response = $transaction->authorizeAndCapture(); if ($response->approved) { echo "<h1>Success! The test credit card has been charged!</h1>"; echo "Transaction ID: " . $response->transaction_id; } else { echo $response->error_message; } ?> I was under the impression handling credit cards was MUCH harder to deal with. Couldn't you just store the $_POST['creditcardnumber'] in a database(not very secure AT ALL)? I would of thought they would have to make you mess with the form submission so their card number is encrpted through the $_POST and Authorize.net is the only one that has the decryption key. Also, doesn't like EVERY credit card processing form require the name on the card? Am i missing something??
  10. I appreciate the comments and suggestions! I have a filter for curse words and i have thought of attempting to code something that grabs their ip and stores it and makes them wait like an hour or however long. I just don't know how to do it since the tweet is done through my server. Maybe javascript to pull their ip? not too handy with javascript
  11. Hey folks, I've been a member of this site for a while through coding of few of my website ideas. (I've used a couple different usernames because i forget my passwords or change emails). I've just finished my new project http://crowdtweeter.com It's a twitter web app where you tweet anonymously via @crowdtweeter. So all of @crowdtweeter's followers see your tweet. It's a tool to reach an audience outside your own followers if you have a twitter account. And no you don't need a twitter account or an account on the website. NO ACCOUNTS. You can: Promote your own twitter account. Share an idea or thought. Give us a favorite quote. Promote your business. Anything really. I thought it was a neat idea so enjoy!
  12. figured it out with magic quotes it's ugly but it fixed it :/ <?php <textarea id=description name=description maxlength="140" > <?php if(get_magic_quotes_gpc()){ echo stripslashes(stripslashes(stripslashes($tt))); } ?> </textarea>
  13. i have a textarea in my form. If my validation script detects an error it will send it to the same page with what they had in that textarea encoded in the url. The script detects the $_GET['variable'], decodes it, and stores it as the default in the textarea so they don't have to retype it all again. The problem is the apostrophes add 7 slashes when it gets added back to the textarea. heres the relevant snippets.. <?php function clean_post($variable) { $cxn = mysqli_connect($host,$user,$passwd,$dbname) or (mysqli_error($cxn)); return mysqli_real_escape_string($cxn, strip_tags($variable)); } $description = clean_post($_POST['description']); $description = str_replace(array('\r\n', '\r', '\n'), ' ', $description); $description = urlencode($description); $base = "http://mywebsite.com/"; $url = $base."?mm=1&tt=".$description; $location = "Location:".$url; die(header($location)); and then to output it in the textarea <?php $tt = urldecode(strip_tags($_GET['tt'])); <textarea id=location name=location maxlength="140" > <?php echo $tt; ?> </textarea> and this is what my url ends up looking like http://mysite.com/wordpress/?mm=3&tt=what\\\%27s+the+deal%3F and this ends up in my textarea "what\\\\\\\'s the deal?"
  14. i have this in a form <textarea id='textarea' name='tweet' maxlength=140 > <?php if(isset($_SESSION['description'])) { echo $_SESSION['description'];} ?> </textarea> the session variable is just their input and i use that to repopulate the form if the validation script catches an error with their input. The problem is when the user enters carriage returns and then if theirs an error.... this... "blah blah blah" turns into this... "blah blah\r\n\r\nblah" how do i remove that junk?
  15. hmm..i tried to implement this code <?php $words = array( 'fuck','shit', 'dick', 'cunt', 'twat', 'motherfucker', 'asshole', 'damn', 'bitch', 'bitching', 'fucking', 'fuckin', 'shitting', 'shittin', 'whore', 'whores', 'slut', 'sluts', 'bullshit', 'ass', 'bitches'); //string to search $string = $sentence; //amount in the array $x = count($words) + 1; while($i < $x) { if(strpos($string, $words[$i]) === false) { ++$i; } else { //holds the number of bad words found ++$b; ++$i; } } if(!$b) { //echo "No bad words found, yippe!"; } else { $_SESSION['message'] = "Your sentence contains curse words. Please remove the foul language."; die(header("location: test.php")); } but it doesn't count them as individual words. For example "I want to go bass fishing" will throw an error for the word "bass" because "ass" is in it. Any ideas how to make it only search for words? It doesn't seem to work if i just put spaces around the words in the array.
  16. I can't seem to find a decent code function to search for "curse" words that i would deem inappropriate in an array. Count the number of instances the function finds a curse word and then if the number is greater than one halt the script. something like the following but not really.... $words = array('ass','fuck','shit'); $string = 'Blah blah blah ass blah blah fuck blah blah shit!'; //code to count the instances of the curse words(3) if($instances > 0) { echo "no cursing please."; } ; any help on how to do this would be much appreciated!
×
×
  • 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.