Jump to content

sKunKbad

Members
  • Posts

    1,832
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by sKunKbad

  1. if you would post your code, it would probably help out other people in the future
  2. you will need to declare your namespaces to get to the content you desire. i did it like this: $namespaces = $feed->getNamespaces(true); $content = $feed->channel->item->children($namespaces['content']); The XML: <?xml version="1.0" ?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/"> <channel> <title>Bible Gateway's Verse of the Day</title> <link>http://www.biblegateway.com</link> <description>A daily word of exultation.</description> <dc:language>en-us</dc:language> <dc:creator>BibleGateway.com</dc:creator> <dc:rights>Copyright 2004</dc:rights> <dc:date>2007-10-03T02:27:03Z</dc:date> <sy:updatePeriod>daily</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase> <item> <title>1 Peter 1:3</title> <description>Verse of the day</description> <guid isPermaLink="false">http://www.biblegateway.com/passage/?search=1+Peter+1%3A3&version=31</guid> <content:encoded> <![CDATA[“[Praise to God for a Living Hope] Praise be to the God and Father of our Lord Jesus Christ! In his great mercy he has given us new birth into a living hope through the resurrection of Jesus Christ from the dead,”<br/><br/> Brought to you by <a href="http://www.biblegateway.com">BibleGateway.com</a>. Copyright (C) NIV. All Rights Reserved.]]> </content:encoded> <dc:rights>Powered by BibleGateway.com</dc:rights> <dc:date>2007-10-03T02:27:03Z</dc:date> </item> </channel> </rss>
  3. $params needs to be an array like this: $params = array('Nickname'=>"$Nickname",'Password'=>"$Password"') curl_setopt($ch, CURLOPT_POSTFIELDS,$params); You have it as $_GET variables in a URL, which is wrong.
  4. so, are you asking if there is a limit to the amount of data that can be stored in a variable? Or do you want to know how to read the file? I think that there may be a problem if the datatype isn't all the same inside the file, but if it is then you should be able to do it easily. Read it in and put it in a variable like this: $filename = "fread_text.txt"; $handle = fopen($filename, "r"); $contents = fread($handle, filesize($filename)); fclose($handle);
  5. I think a lot of times hosts have little tips regarding database hook-up, and you might check with your host. Post your connection script and let us take a look at it... minus the real password and username of course.
  6. I've seen php code that was completely encrypted, but how easy that is to crack I don't know. I think the truth is, is that your offshore buddies don't give a hoot about copyrights or copywrongs, so you should try the encryption. At least if you encrypted it, they would have to be smart enough to crack it.
  7. if ($_GET['Ord'] == ""){ $Ord = 'ID'; }else{ $Ord = $_GET['Ord']; $sql = "SELECT * FROM store ORDER BY `$Ord`"; }
  8. WAIT! Godaddy has a special database connection script. It isn't standard php/mysql. I know because I have godaddy accounts. Maybe this is your problem??? $x = "p83mysql62.secureserver.net" ; $y = "database_name_db" ; $z = "FunKyPassWoRd" ; $xyz = @mysql_connect($x,$y,$z); if (!$xyz) { die('Could not connect to database'); } $db = @mysql_select_db ($y,$xyz); if (!$db) { die ('Database cannot be found'); }
  9. I came up with this script based on the links you provided. I'm sure it is a security nightmare waiting to happen, but it shows that this can be done easily (since I still consider myself a php noob). <html> <head> <style type="text/css"> #editbox { width:500px; height:200px; } </style> </head> <body> <?php if ($_GET['editbox'] != ""){ $filename = 'fread_text.txt'; $somecontent = $_GET['editbox']; if (is_writable($filename)) { if (!$handle = fopen($filename, 'w')) { echo "Cannot open file ($filename)"; exit; } if (fwrite($handle, $somecontent) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote ($somecontent) to file ($filename)"; fclose($handle); } else { echo "The file $filename is not writable"; } }else{ $filename = "fread_text.txt"; $handle = fopen($filename, "r"); $contents = fread($handle, filesize($filename)); echo "<form action='fread.php' method='get'> <input type='text' name='editbox' id='editbox' value='$contents'></input> <input type='submit' value='Submit' /> </form>"; fclose($handle); } ?> </body> </html> My fread_text.txt file just had some numbers in it like "293842938" to start with.
  10. It doesn't matter if its from a form or not, its still GET, and a user can still mess with you depending on the usage. For instance if you are using the GET variables to access database information, a user could try to inject and kill your database. You need to learn a bit about regex, and filter the GET variables before they are used in your scripts. Regex is not very hard to learn. There are great websites and tools that make regex a no brainer. I got a tool from regexbuddy that makes writing regex super easy.
  11. ok, at least on my server(s), you are not able to include files with the http:// prefix. You must use a relative path such as: <?php include '../robots.txt'; ?>
  12. I have some godaddy sites, and yes they do have a unique type of database login. Don't ask why, it's just the way it is.
  13. try include ('http://mydomain.com/folder1/folder2/file.php');
  14. You might try the installation forum.
  15. Can you be more clear as to what you want to do.
  16. I have seen color matching programs that do it based on the rgb value. The particular program that I have worked with gives you a percentage of how close that color was by checking the rgb values. The problem with hex is that it isn't easy to compare without converting to another color system. Heck, it isn't easy to know what color a hex number is just by looking at it, whereas looking at an rgb value gives you some numbers that you can at least guess with.
  17. sKunKbad

    Date -

    <?php $futureDate = "2007/10/2 13:10:50"; $futureD = strtotime($futureDate); $now = time(); echo "The number of seconds till ". $futureDate ." is ". ($futureD - $now); ?>
  18. Sorry, but the function display_xml is not in the online manual. That's what I get when I go to php.net
  19. <?php $startDate="01/01/2007"; $endDate="01/08/2007"; $startD = strtotime($startDate); $endD = strtotime($endDate); $diffSeconds = $endD - $startD; $days = ($diffSeconds / 86400); for ($wd = 1; $wd < $days; $wd++) { $weekdays = ($startD + 86400*($wd)); echo date("d-m-Y",$weekdays) . "<br />"; } ?> If you want the difference to include the first day, then change the for loop to $wd = 0.
  20. I'm playing around with it, but can't promise anything. I'll post if I figure it out.
  21. I can't, but I'm interested where you got it.
  22. My pleasure. Figuring out other peoples problems with php is like a game I play when I'm bored. Keeps me fresh with the php knowledge.
  23. <?php $text = nl2br('This is a test 1 2 3'); echo $text; ?>
  24. If you got it working, do you mind posting your code so we can see?
×
×
  • 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.