Jump to content

dude753

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dude753's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi there, I never did manage to solve this myself. I had a thorough look on Google and found a lot of people asking how to deal with empty RSS feeds but no answers. Could anybody alter the code to provide an error message if the feed is empty? Thanks for your patience!
  2. Hi there, I'm using a module called AG My Auctions in my Joomla site to display my eBay auctions in the footer of the page. I won't always have auctions running, so I'd like it to show a message when there are none. I used to be able to make my own basic PHP scripts so would have thought I could do this but apparently not. The code is: <?php /** * Modulo Sagre in Italia". */ // no direct access defined( '_JEXEC' ) or die( 'Restricted access' ); function getFeedAGMyAuctions($feed_url, $max_items) { $countitems=1; $content = file_get_contents($feed_url); $x = new SimpleXmlElement($content); echo "<table border='0' cellpadding='0'><tr>"; foreach($x->channel->item as $entry) { echo "<td><a href='$entry->link' title='$entry->title'>" . $entry->title . "</a>"; echo str_replace ("$" , "$ ", $entry->description); echo "</td>"; $countitems+=1; if ($countitems>$max_items) { break; } } echo "</tr></table>"; } $maxitems=$params->get('maxitems'); $feedurl="http://rss.api.ebay.com/ws/rssapi?FeedName=SearchResults&siteId=0&satitle=(".$params->get('keyword1').",".$params->get('keyword2').",".$params->get('keyword3').")&language=".$params->get('language')."&output=RSS20&sass=".$params->get('username')."&frpp=2&rows=2"; getFeedAGMyAuctions($feedurl, $maxitems); I've tried things like echoing an error message if $countitems == 0 but for some reason can't get anything to display. Quite frustrated that I haven't worked it out. Anybody able to point me in the right direction? Thanks a lot,
  3. Hey, I've looked and looked but I just can't find anywhere which says how to do this. Here's my query. I want it to show info from just 2 specific categorys, not any of the other possible categories. Here's one of the variations I tried: I also tried: I can't seem to get this to work. Any ideas? Thanks
  4. Hey :D Sorry I've never used Javascript before but tonight on my site there is suddenly a massive demand for a really really simple calculator. I was hoping somebody could make it here? Basically the calculation is: 75 * X = Y I need users to be able to enter X and the answer appear without the page reloading. I'm going to try to do it myself but since I've never used Javascript before I might fail... I'd really appreciate your help :). Thanks
  5. Howdy I have a drop down menu which has multiple selection enabled. I want to put all the options selected into a db seperated by a commar. So: Orange|Red Etc. Here is my code: [code]<td width='30%' valign='top'><strong>Access</strong><br><i>To select more than one category hold ctrl then click.</i></td>       <td valign='top'><select name='access' multiple='multiple' height='$height'>"; while($r=mysql_fetch_array($result)) { // start looping   $name = $r["name"];   $id=$r["id"];     echo "<option value='$name'>$name</option>"; // echoing out different categories   }     echo "<option value='Admin'>Admin</option></select>     </td>[/code] Then, to insert it into the db I have: [code]else if($_POST['Submit'] == "Update") //if submit is hit { mysql_connect("$localhost","$dbuser","$dbpass") or die("error"); mysql_select_db("$dbname") or die(mysql_error());   //makes incoming data variables   $username = $_POST['username'];   $password = $_POST['password'];   $access = $_POST['access'];   $id = $_POST['id'];       if($username && $password && $access) { $password = md5($_POST['password']);     $result = mysql_query("UPDATE users SET username='$username', password='$password', access='" . join(",",$_POST["access"]) . "' WHERE id='$id'") or die (mysql_error()); }[/code] For some reason this isn't working at all. It only allows me to select one option on the drop down. Any idea why this is? I'm usnig Firefox. Thanks!
  6. Ok thanks. Is it ok to have directories set to 777 or not? I seriously cant believe there are so many scripts that tell you to use 777 when this can be so easily used to hack files.
  7. But even CMS like Joomla have things like the config file set to 777?
  8. Hey! I volunteer on a fairly popular fan site. We've been using the same news script for about 2 years, then we moved server and suddenly it got hacked. The script is Cutenews and has lots of files on it which have to be CHMODed to 777 like news.txt and templates etc. We have never had any problems then suddenly we start getting hacked via the template files in Cutenews. We installed another news script, Fusion News. Again we get hacked through our templates, which were 777. Is it because the files are 777 that they are being hacked? If this is the case then why do a lot of scripts require you to have files CHMODed to 777? Is it because of a bug on our server that we keep being exploited? Thanks <3
  9. [!--quoteo(post=347945:date=Feb 21 2006, 01:28 PM:name=heckenschutze)--][div class=\'quotetop\']QUOTE(heckenschutze @ Feb 21 2006, 01:28 PM) [snapback]347945[/snapback][/div][div class=\'quotemain\'][!--quotec--] One very large problem with the code mentioned, is remote script execution is possible. Eg if I made a script on my site that destroyed everything if run, I could tell your script to run/include it. The following would work: index.php?page=http://mysite.com/destroy[!--coloro:#CCCCCC--][span style=\"color:#CCCCCC\"][!--/coloro--][i].php[/i][!--colorc--][/span][!--/colorc--] Therefore, causing destroy.php to be included into your page, as if it was a file on your site. A common work around is to use switches: [code]<?php switch($_GET["page"]) {     case "page1";         $page = "page1.php";         $title = "My page title.php";     break;          default:         $page = "main.php";         $title = "Home";     break; } include $page; ?>[/code] hth someone. [/quote] Could I also stick my site URL infront of the $page value? So that if someone tried to put their own URL in it would be [a href=\"http://mydomain.com/index.php?page=http://theirsite.com/destroy\" target=\"_blank\"]http://mydomain.com/index.php?page=http://...ite.com/destroy[/a] Then $page would equal [a href=\"http://mydomain.com/http://theirsite.com/destroy\" target=\"_blank\"]http://mydomain.com/http://theirsite.com/destroy[/a] and this would give a 404.
  10. Howdy, I found this code on a search. I used it and it worked. I just changed the "s to 's and it stopped working. I was just wondering why? It causes no problem I'll just use "s instead. [code]include ("$page.php");[/code]
×
×
  • 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.