Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. Your guess is correct. Are you using free hosting? I've known it be disabled on those kind of hosts before.
  2. You're problem is not urgent. It is no more urgent than any other topic here. If you want to have priority over other people, i suggest you pay for it.
  3. Since you're having troubles with the flash/action script part of this, you shouldn't be posting in the PHP section of the forums. I've moved it here so that it might get the attention of people who know more about this subject.
  4. Unless there's already a function for this, probably the easiest way would be to use the wordwrap function to get lines of the desired lenth, then explode the string and use the first index of the resulting array. Alternatively, you could explode the string by the space, and loop through the array checking the length of each part. If adding the word doesn't take you over the limit, append it to the generated string. If it does, don't add it and break out the loop.
  5. You can use wildcards with the glob function.
  6. Which is correct. You're fetching a website's source code and displaying it in a browser. Thus the page is rendered exactly as it is on the original site. Run the $file through the htmlentities function before outputting to the brower to see the source code. This will convert all special HTML characters to the equivlant codes, preventing the browser from interpreting their special meaning.
  7. Perhaps...though i wouldn't recommend using the image tag's attributes to 'resize' an image...you're loading a file that is larger than necessary. That's bad for you and for the visitor; neither of you want more bandwidth than necessary. Better to resize it permanantly. People aren't here to write your website for you. If you're after that, you should use the freelance section and be prepared to get out your wallet. Third_degree has put you on the right track with number 1, though filetype wont quite do what you need. It'll tell you if something is a file, directory, or something else but not if it's an image. It's probably sufficient to check the extension of the filename for image extensions since you'd hope you're checking any uploaded files to ensure they are images. You'll also need the glob function to cycle through the files in the directory.
  8. If you would like someone to do this for you, i suggest you post it in the freelance board. Otherwise, i suggest you try a little harder. "Here's my code, please finish it for me" is unlikely to cut it.
  9. If that's your exact code then your main problem is with the first line: $query = "SELECT * FROM UserTable WHERE username=".$_Post['username']; You've not placed the username that you're searching for in quotes, which is something you must do for all strings in your query. A cleaner version would be: $sql = "SELECT COUNT(*) FROM UserTable WHERE username= '" . $_POST['username'] . "'"; $result = mysql_query($sql) or trigger_error(mysql_error(),E_USER_ERROR); if($result){ if(mysql_result($result,0) == 0){ //username not taken }else{ //username taken } }else{ //problem with query }
  10. Well what have you tried? The basic process is to select the rows from the database where the username is equal to the one the current user is trying to register. You then take a count of the rows. If it is 0, the username's not been taken. If it is 1, it has.
  11. Assuming you're using a PHP version less than 6, you'll just have to set the error reporting level to E_ALL. You can do this at run-time like so: error_reporting(E_ALL);
  12. I suggest reading up on references in the manual: http://us2.php.net/manual/en/language.references.php
  13. So the issue isn't with the display of the above? It's more with using multiple select boxes? May we see the code that you have problems in this area with? I suspect what you need to do is name the select boxes as an array and loop through the results when you process the form (a process similar to which, albeit using checkboxes, can be found here). I might be wrong, however, which is why we're going to need to see some code.
  14. Maybe try Project Euler. Heh, I think i might try and do a few more of these in my spare time over the summer. They can be irritating though...I just did problem 15 in what I thought was a very elegant way (using a dynamic programming approach) but it then turns out there's a far simpler way with some simple maths. Grrrr. I guess that's kinda they point of these things though...
  15. Well why don't you have a go first? I'm sure you can work out how to prevent the ID from being displayed. And i'm sure you can attempt to output a select box in the loop. There's not much point in following a tutorial and not attempting to alter it to your needs. If you get stuck with something or you get errors you don't understand, then post back here and i'm sure people will help. You might have some troubles getting the form to work properly, but once you've got it displaying correctly, we can deal with that.
  16. You can use the substr function to do what you need. Select the first 7 characters from the string and check if it is equal to "http://"
  17. I'd assume you're applying stripslashes unnecessarily.
  18. Yes it is important. You shouldn't be storing values in a varchar field. Use an INT field. You can format the values as you like when you output the data( e.g. number_format) If you store numerical values in a varchar field, any ordering on them will be done lexicographically. It won't be a "natural" order (that is, the way in which a human might order them) and so you're going to get odd results.
  19. Have you tried making sure that your variables are actually set and contain the correct data? It's a pretty common error if things are working OK when you use phpMyAdmin... $sql = "SELECT * FROM _Form_Nr_2 WHERE preco BETWEEN '$preco1' AND '$preco2' "; echo "<br/>Query: $sql <br/>";
  20. Try this resource: http://www.lmgtfy.com/?q=javascript+pop-up
  21. That would be called a pop-up. Yes, you can. But not with PHP. You'll require some Javascript if you wish this to be automated.
  22. Well, why don't you try debugging your update query? Or, indeed, echoing the value from the database before you do anything to it? I'll direct you to the database errors section of a tutorial i wrote: http://www.phpfreaks.com/tutorial/debugging-a-beginners-guide On the other hand, you don't need to select something from a database in order to increment it. You can do the following instead: UPDATE yourtable SET foobar=foobar + 2 WHERE ...
  23. Err, so you want to force the user to click on your banner? What did you have in mind....a hand popping out of the screen and guiding the mouse? What happens when a user clicks on the banner? Does it open a new link? Why not have that opened anyway....if you really want to that is. Personally I wouldn't visit your site twice if it forced me to do something...
  24. I'd go with your PHP solution.
×
×
  • 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.