Jump to content

benn600

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

benn600's Achievements

Member

Member (2/5)

0

Reputation

  1. I've spent a lot of time trying to find an appropriate XML parser for PHP that I can get to work as I need. The developer info is here: http://developer.yahoo.com/weather/ and the feed is here: http://weather.yahooapis.com/forecastrss?p=52402 The main piece I want to extract is: <yweather:condition text="Mostly Cloudy" code="26" temp="57" date="Tue, 29 Nov 2005 3:56 pm PST"></yweather:condition> -- specifically, the code="26" piece. With this code, I can read from the array of codes and print the condition--and also print an image with the info. I was using SimpleXML but it does not include the "yweather:" branches or the internal attributes. How do I access these? I'd like to add this weather to my personal homepage site. Thanks!
  2. I have a div that is positioned fixed, with some IE fix CSS. It is positioned about 150 pixels from the top and remains there as the page is scrolled. What would be the most elegant, simplest way to have this box scroll up to the top of the browser window and then remain in place? The problem is that this box, solid black (with select drop down contents) does not span to the top of the page so when users scroll down, the content is seen below and above the box. The fixed box should float up to the top of the window. CSS only would be preferred, obviously! To get around the fixed position issue, I created two divs with one absolutely positioned and the other fixed. Then, I used some body / html manipulation to clean it up and it works great in both IE & Firefox. Thanks.
  3. Problem solved. I tried chmod-ing as I should in FTP but it didn't take. Assuming it was my mistake, I posted unsure. Well, after contacting my host, they told me I have to chmod through the web admin interface. Doing so solved the problem. Thanks for reading!
  4. Makes sense. Sorry for the sudden topic change. But any ideas anyone?
  5. I solved the problem by removing some logic: if (mysql_num_rows($queryResult) > 0) return $queryResult; else return 0; changed to just return $queryResult; Now my photo gallery upload is having some trouble. I'm seeing these errors after trying to upload a picture: Warning: move_uploaded_file(c:\[...]\gallery\full\14.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in C:\[...]\includes\functions.inc.php on line 635 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'c:\php5\uploadtemp\php5323.tmp' to 'c:\[...]\gallery\full\14.jpg' in C:\[...]\includes\functions.inc.php on line 635 I tried chmoding the folders but they are already 666 (read and write (no execute)). Would this work? But when I tried 777 it didn't take. Of course this is probably something to do with my host. What do you suggest?
  6. Yes, but I have die in my select queries...all of them. I use this function to handle all my select queries. function handleSelect($q='',$test='') { handleTest($q,$test); $queryResult = mysql_query($q) or die(mysql_error()); if (mysql_num_rows($queryResult) > 0) return $queryResult; else return 0; }
  7. The first error I see on the page refers to this line in my code: if (!mysql_num_rows($input)) So I changed it, adding the error item: if (! (mysql_num_rows($input) or die(mysql_error())) ) Then I get this error and it dies: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\[...\\includes\functions.inc.php on line 68 Is there a chance the server has older PHP or MySQL? The top line of code is the first line of code in the offending function. The function is: function badPageExit($input='') I added ='' on all my inputs everywhere because the php.ini file must be configured differently from mine as my server allows this less strict programming style.
  8. I wrote a basic content management system and want to set it up on another server. On my server, it works great. On this other server, I can't get it to function properly. It shows tons of errors. The first errors were that I was not passing values to all function inputs. Is this horrible programming practice? If I create a function with three inputs, sometimes I really only need one input. The quick fix is to add ='' after each input variable, right? So I did that and 80% of the errors disappeared. Now I have some PHP/MySQL errors. Here are a few. Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\[...]\siteroot\nunemaker\includes\functions.inc.php on line 68 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\[...]\siteroot\nunemaker\includes\template.inc.php on line 41 I really appreciate any assistance on this!
  9. So how do I fix the cross site scripting vulnerabilities of my site?
  10. This is unbelievable and I'm outraged that Gift Pathways is so broken. What can I do to help fix it? It seems like there are two main problems: 1. Apache is accepting a connection to a specific file (index.php) even when there is a slash after the filename. 2. The quotes need to be replaced with &quote; Would these two things fix most of these problems? How can I remedy the first? It seems very standard for you guys to tell me about all these problems so surely you have a moderately simple remedy for fixing them all! Do you have a bot that collects all this information? As far as "a" going to the date field on the group creation page, is it bad that I don't care that it gives a mysql error? Honestly, that is only for the hackers. What is the easiest way to check anyway in PHP? How can I check to see if a date is valid in PHP? Why should I? The only advantage would be that if users enter an invalid date (Feburary 31). So I wouldn't mind adding code here. How do I see if a date is valid? I have a good error scheme and it would be easy to add that in.
  11. What if I just checked the URL and if it has something after .php other than a question mark, exit?
  12. It's for both purposes. How the heck did you do that?! How do I fix it? I had some others test some general security issues but I have never seen that before!
  13. Well, I created a PHP/MySQL site that I would like to tell everyone about. It's called Gift Pathways: http://giftpathways.com/ It lets users signup and create a group for their entire family/group. Everyone then signs up and joins the same group. Each person then has a wish list and can mark other people's items as purchased (secretly). Plus, you can generate printable shopping lists, comment on items, add secret surprises, and much more. Please let me know what you think! I would appreciate help spreading the word because everyone I have personally told about it loves it. My family is using it, too. I told my co-worker and just a couple days later, his wife said it would be so cool if there was a site where you could put a wish list --- just like my site! Well, honey, there is! lol I made two versions over about 2-3 weeks. The first was just for my family and the second added public registration with groups to contain events. I'm constantly expanding it but will even be more motivated with more users. I want it to be USED! Please tell your friends!
  14. What PHP code would I need to simply download an image from an internet address and save it to a location on the server? At regular intervals? Can PHP somehow be added to the Windows task scheduler? I have some security cameras that can FTP images to my server but when I have the FTP enabled and uploading images every 10 seconds, they become unstable and crash. Viewing the image through the web browser doesn't seem to make them unstable.
  15. I have a site, http://giftpathways.com which tracks user's wish lists (mainly for Christmas lists at this time). It keeps track of wish lists based on group, wish list items, and comments on those wish list items. With my actively used group, we have 13 users with around 150 wish list items/comments. It quickly grew beyond the scope of checking every page for changes. I need a way to list unread items. Specifically, I have three in mind: new members to the group (therefore, new wish lists), new wish list items, and new comments. I was thinking of the best way to do this and it seems like the most accurate way is to create a new table that lists every item that was read. So, if the item is not found, it has not been read. The site is still very small but I'm not sure if this could quickly grow exponentially and be a bad choice as it would mean tons and tons of records. One for every item times the number of members. Anyway, I need help getting the mysql code down. How can I compare two tables: Tables "groups" and "pageViews" track this. I'm using an ID on pageViews to identify if the item is a groupmember, wishlist item, or comment. Then, the ID # refers to that type and the respective table is used. Group members are identification number 0. So I need all items from "groups" returned where an entry DOES NOT exist in "pageViews" ... this is a tricky one, I think! Once that new group member's page is visited, the value could be inserted. As a side note, I already have a counter tracking every page view. It probably already has sufficient information to do this! In fact, it really does! So users wouldn't have to start at having read nothing. Plus, that would mean no additional table. But I still have to solve the problem. Any ideas? Left and right join don't seem to help.
×
×
  • 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.