Jump to content

Philip

Staff Alumni
  • Posts

    4,665
  • Joined

  • Last visited

  • Days Won

    20

Everything posted by Philip

  1. http://www.phpfreaks.com/forums/index.php/topic,37442.0.html
  2. public_html/image.php?id=123456 is called, checks to see if current user is logged in yes - read 123456's image data (from under the public_html folder), output with correct header no - don't display image Really, no matter what I could go to a facebook photo, right-click and get the image url and give that to you and you could see it - even if you didn't have the permissions to view it originally. Yeah, it would just be the image, no comments, info, etc, but it is still the image.
  3. Philip

    Google OS

    I use Chrome as my main browser and rarely have problems, I think it's doing pretty "well". As for the OS, I wonder what the battery life will be like compared to current netbooks. I already get like 6hrs off of mine, and thats running XP with a few apps open.
  4. Good to hear you got it to work. Next time, just be sure to post more details and we can help you get to your conclusion faster and more efficiently.
  5. Yeah, in PHP it will always be like that.
  6. for ($i=1; $i<=100; $i++ { Should be: for ($i=1; $i<=100; $i++) { (notice there is no semicolon on the last argument in for)
  7. Right! All 1 or 0? Never ever a string of some sort.. Oh no wait we'll just add an if to our loop and a while later hey let's add an if to our loop and a while later hey let's add an if to our loop... Good thing you know what spaghetti code is It is spaghetti code Technically it's a hack. Know your framework.. It just doesn't make sense, because you already should be checking it server side to make sure the value is still correct. With your method - the fallback hidden field, I could easily forget that I need to check to make sure it is a 1 or 0 and nothing else. If I'm already checking for for the correct data type, I might as well just see if there is a checkbox field, and if so put my own default on there.
  8. Your extension shouldn't be .xml, it should be .php
  9. script.php?id=123&blah=trgd#test worked for me
  10. Yeah, that's kinda bad practice to have an extra hidden field. And this should be the following to avoid any notices/warnings: $checkVal = (isset($_POST['checkboxName'])) ? 1 : 0;
  11. What errors are you getting? Also try this (some of your quotes were off): <?php header('Content-Type: text/xml'); echo '<?xml version="1.0" encoding="ISO-8859-1"?> <rss version="2.0"> <channel> <title>Gamedot.</title> <description>The latest news, reviews and features for all consoles, the PC and handhelds.</description> <link>http://www.gamedot.co.uk</link>'; $get_articles = "SELECT ArticleID, Headline, ArticlePreview, DATE_FORMAT(Date,'%a, %e %b %Y %T') as formatted_date FROM tblArticles ORDER BY Date DESC LIMIT 2"; $articles = mysql_query($get_articles) or die(mysql_error()); while ($article = mysql_fetch_array($articles)){ echo ' <item> <title>'.$article['Headline'].'</title> <description><![CDATA[ '.$article['Preview'].' ]]></description> <link>http://www.gamedot.co.uk/article.php?ArticleID='.$article['ArticleID'].'</link> <pubDate>'.$row['formatted_date'].' GMT</pubDate> </item>'; } echo '</channel> </rss>'; ?>
  12. You're fine as long as you double check to make sure it is just a number, and nothing more.
  13. Or, as long as your OS supports it (most do) echo count(glob("path/to/dir/*.*"));
  14. That last $i++ isn't needed for ($i = 1; $i <= $Outof; $i++) { echo '<input type="radio" name="Title1" value="'.$i.'" id="Title1_'.$i.'"/>'.$i; }
  15. Or using native PHP functions: <?php // Our string $string = '1234567890'; // show the string, plus line break echo $string.'<br>'; // Create an array element for every 2 characters, then implode it with a space. $withSpaces = implode(' ', str_split($string, 2)); // show the string with spaces, plus line break echo $withSpaces.'<br>'; // Create our reversed string $revString = strrev($string); // show the reversed string, plus line break echo $revString.'<br>'; // Create an array element for every 2 characters of our reversed string, then implode $withSpacesRev = implode(' ', str_split($revString,2)); // show the reversed string with spaces echo $withSpacesRev; ?> Outputs: Which, technically doesn't do exactly what you want. "12 34 56 78 90 will become 90 78 56 34 12" - did you mean reverse the order of the 'sets', or reverse all the numbers?
  16. http://www.webmasterworld.com/forum88/7299.htm
  17. You'd need to create a custom PHP script that the cron runs. This would need to keep track of where the last cron job left off (thus where it should start) and then contain the loop. I'd just setup the cron via cPanel.
  18. header("Location:...");? Sorry - misread part of your question. When they visit the login page, you could have the link like: login.php?redirect=members - Then pull the redirect page by $_GET['redirect'] and act accordingly.
  19. A cron would work, maybe not the best solution but it would work.
  20. zomg NINJA!
  21. Without specifics of what you'd like to do to your data, it is hard to give the best solution for your needs. If you do keep looping it the way you are, you need to make sure to give your server some breathing time every couple of thousand rows.
  22. Well, for your example this one query would do the trick: INSERT INTO otherTable SELECT (num1/2) as num1, (num2+5) as num2, (num3*10) as num3 FROM firstTable num1 num2 num3 56 23 54 123 486 123 48 34 123 6456 321 6 65 1 23 564 123 123 46 89 654 456 231 564 489 65 2389 8956 56 23 Then after the query, the second table: num1 num2 num3 28 28 540 62 491 1230 24 39 1230 3228 326 60 33 6 230 282 128 1230 23 94 6540 228 236 5640 245 70 23890 4478 61 230
  23. His computer probably melted itself after clicking "Post"
  24. @AwptiK: Actually, echo "$variable" is okay, as double quotes (") will parse variables. Single quotes (') will not and will treat anything in them as a string. @Garethp: which quotes are you referring to? @OP: What is it doing? Does it show the thank you page, but doesn't send the email?
  25. It's all about word of mouth about the price to quality of your services & presentation of yourself. I've done some work for local clients, and when someone asked about their website, they have always referred them to me. Personally, I prefer working for local clients because the communication piece is so much easier, I mean if I have a question or presentation I don't have to worry about any time zone changes, I can swing by their office, etc. I know of a few people that have posted on here, proved that they have quality work, and were offered a couple of jobs.
×
×
  • 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.