Jump to content

dbx

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Everything posted by dbx

  1. I've been thinking of making a site for myself where the content would come from various web sites. For example I would get the feeds from my favourite football team and from my favourite music artists etc delivered to my site. I know how to get a page to open a feed and display the content on a page, but what if I want to make the articles searchable etc? Should I setup a cron job or something to get all the feeds and store them in my database and make the pages from the database rather than the feeds? I really have no idea what is best/possible. Any suggestions would be great. Thanks
  2. Hi, I used to use JSP on my site, but have now moved to php and need to do some redirects. I need to do the following: view_project.jsp?project=01 to redirect to view_project.php5?project=01 view_project.jsp?project=02 to redirect to view_project.php5?project=02 ... view_project.jsp?project=100 to redirect to view_project.php5?project=100 everything i have tried so far doesn't work. E.g. RewriteCond %{QUERY_STRING} ^project=1$ RewriteRule ^(/)?$ http://www.domain.com/view_project.php5 [R=301,L] Any help would be appreciated!
  3. dbx

    Timeout

    Hi, I have a page that displays one of two forms based on a cookie that is stored on the user's computer. Every time the page loads, AJAX checks the cookie and displays the correct form. While AJAX does this, it displays a small loading image. If, while it is loading, i click a link somewhere else on the page that uses AJAX, the form will not load and the loading image will keep going. Is there a way for me to force it to try again after a certain amount of time? Or to display an error requesting they reload the page to try again? Thanks.
  4. My pages use ISO-8859-1 I need to include a file in all my pages which uses UTF-8 to display Russian text. I get the "headers already sent" error when I try to repeat the character encoding line in the include file. How can I do it? Thanks.
  5. It didn't work. It added a trailing slash when I tired site.com/index.php but not when i tried site.com/indexd Any ideas?
  6. The error page I have added to my site works fine unless I try call a folder than does not exist and don't include a trailing / It's a PHP error page and the browser simply displays the unprocessed code. I have "RewriteBase / " in my .htaccess file which I thought appended a / to the url if it was missing. My hosting company said it's a scripting issue, but I doubt that considering the page is displayed for regular pages and if I include the / Any ideas? Thanks.
  7. I am (was) using 4. My server supports PHP5 if I use the .php5 file extension. I've renamed the files and changed that line of code, and it works! Thanks for that.
  8. I'm trying to teach myself OOP, and it's not going well =) Can someone tell me what is wrong with the following code?: The class I created: <?php class numbersgame { var $number; function setNumber($num) { $this->number = $num; return; } function getNumber() { return $this->number; } } ?> The page that uses it: <?php include("the_class.php"); $newgame = new numbersgame(); numbersgame::setNumber("3"); $res = $newgame->getNumber(); echo $res; ?> Now, the way I see it... it should set number to "3" and display it on the page. At the moment, it doesn't display anything. Why? Thanks.
  9. }elseif(($Marebreed == 'Quarter Horse' || $Stallbreed == 'Quarter Horse') && ($Marebreed == 'Azteca || $Stallbreed == 'Azteca')){ $Foalbreed='Azteca'; Azteca is missing its closing '
  10. the page i'm talking about only displays data on one individual, so now data would be mixed.
  11. Hi, I hope this is in the right section. I'm not sure if this is more css or php. I'd accept a solution in css or php... I'm taking about 20 items from a database: First name, surname, age, DOB etc Some of these items will have values stored and some will not. When my script takes them from the database, I am displaying them in 4 columns across the page (5 per column) At the moment, each column only displays certain values. E.g. first column contains name, surname, age, dob, location If the age is missing, nothing is printed and only 4 items will be displayed in that column. If the surname, age, dob and location are missing, only the first name would be displayed, resulting in only 1 item in that whole column. How can i change things so that if something is missing, something from one of the other items will fall into its place? I would rather have 3 complete columns from left to right and nothing in the fourth than 2 items in the first, 5 items in the second, 4 items in the third and 4 in the fourth. Thanks.
  12. In regards to coding practice, is it better to use curly brackets or the long syntax error prone way?
  13. Since I started coding in PHP I have been including variables in echo statements like this: echo "My name is ".$name." and I am 5 years old"; I've just realised that I can simply type: echo "My name is $name and I am 5 years old"; Can anyone tell me why I would have been doing it the first way? Is it the proper way to do it? From a previous version? Did I just pick the wrong tutorial to read? =( Thanks
  14. thanks. so there is no keyword or anything that can be used to say "no maximum"?
  15. sorry, I should have explained it a little better. the query is generated from form results, and sometimes it will be "between 0 and 10" etc one of the options is "No Maximum" and its value is currently set to 999999999999
  16. my db holds the size of something in metres. I know the size won't realistically be over 10,000, but I want to include any possible number. At the moment, I have "where id between 0 and 9999999999999" Surely there is a better way to do this? Thanks.
  17. it's a PHP currency converter it takes the value, checks what currency the user has chosen, does the conversion, formats the result and displays it on the page. if this can't be done, it's not a problem. it was just a minor improvement rather than a necessity. i'm not going to modify functions or create new ones to do it.
  18. con() is a function I made. it is included in the <head> section along with some other things
  19. Thanks for that. eval("\$text = \"$db_text\";"); will print out a string. it doesn't seem to like functions though. $db_text = "blah blah <?php con("123"); ?> blah"; doesn't work. Do you have to use something different for functions?
  20. I'm storing text in a database and I want to include PHP code in the text. E.g. I store the following in the table: "blah blah blah blah blah <?php echo "hello"; ?> blah blah blah" When my script gets the text from the DB and displays it in the browser, nothing shows up where <?php echo "hello"; ?> is. Could someone please tell me how I should be doing it? Thanks
×
×
  • 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.