Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. Possibly need to use trim() ..
  2. Personally I think 4 spaces is ideal, and generally the norm' to use. Most editors should have the functionality to replace tab with x number of spaces so you don't have to hit the space bar 4 times. 2 I think still looks a little cluttered and unclear in certain areas. Halo* you didn't really do much of a job indenting the code if I'm honest. What's happening here for example... if($finalcash <0) { echo "You do not have enough cash!"; } elseif($finalcash >=0) { $num_true=mysql_num_rows(mysql_query("SELECT * FROM family WHERE id >1")); if($num_true >= 5) { echo "There are already 5 Crew Slots!"; } else { $num_true=mysql_num_rows(mysql_query("SELECT * FROM family WHERE name='$familyname'")); if($num_true >= 1) { echo "There is already a Family with that name!"; } else { function change($msg) { $post = $msg; $post = str_replace("'", "`", $post); return $post; }
  3. Only given it a quick glance, but this should help... http://www.webweaver.nu/html-tips/web-redirection.shtml
  4. I can't seem to see a great deal of difference in speed. You do loose the functionality of the back button though... And of course you loose all the extra features that comes with Google. Is there an image search?
  5. .... touché
  6. http://www.electronista.com/articles/09/10/21/microsoft.promos.win.7.with.bk.deal/
  7. Perhaps think about why you never see other pages with scroll bars in the middle? There are many other methods to *including* content into a template, without the use of frames or having to update 20 pages for a single change. Take a look at PHP includes (personally I prefer require_once to include files).
  8. Show the code?
  9. Think your problem's here.. if( mores != -1 || 0){ Should just be: if (mores != -1) { Remember 0 is a valid match. Also if you were wanting to check against -1 or 0, you'd need to use: if( mores != -1 || more != 0){
  10. Lets be honest here, Microsoft would be no where they are today if it wasn't for their OS. If you think of Microsoft, the first thing that comes to mind is "OS", not "Big evil money greedy cooperation" or "MSN" or "Microsoft word" or anything else that isn't an OS. Although I guess you could bring up Vista as an example if you want to MS bash but thats a little done over. Not arguing they wouldn't. Saying you can't say Microsoft isn't an 'internet company' since the fact that they've held the title of the most used web browser since about 1995. Not to mention most commonly used IM software, developed scripting languages and frameworks (.NET, VB Script, Silverlight, to name a few), search engines, the list goes on and I'm not going to try and think them all up. But they have a huge presence (if only second to Google these days) on the internet, they are not a company plainly or mostly about operating systems.
  11. That kind of defies the point of caching? Caching allows regularly accessed data to be converted to static content for faster processing / inclusion. If you're updating the content all the time, you'd have to update the cache all the time; either case though it can still serve a useful purpose. You're not being very clear as to what the settings are for. First post you mentioned blog settings like the title, now you're saying user settings? For user settings, as you said, sessions are most commonly used for this. It could depend upon the complexity of the blog settings as to what storage method is right for you though. XML allows you to define much richer data, beyond just the simple 'property' : 'format' style. JSON isn't really meant for storing like a config file. It doesn't have the ability to remove / add nodes as XML does which could make modifying and updating your config file a bit bloated and slow. Perhaps cache the blog settings into JSON? I don't know much at all about YAML.
  12. XML, it's the future!
  13. Agree with the points above. Also think you can tell you've used a template a mile-off. I know you said you did, but it's obvious with the difference between the content you've done and what was with the tutorial. Your content is very small, hard to read and not well thought out. The word to describe it won't come to mind but it's very "line-by-line" / Word like, if that makes sense? As apposed to a gridded / multi-column|row layout where the content floats to the side of each other and makes full use of space. Personally I think you should drop the template. It's very distracting and kind of feels like it gets in the way. Don't really know what it has to do with the theme of the content anyway?
  14. Perhaps going the wrong way about trying to achieve "example.com/username"..
  15. Hah, oh dear. And not an internet company? What's the .NET framework all about then?
  16. It won't do, you're just echoing a form tag? You'll need to use the header function to redirect: header("Location: next.php");
  17. In what way does it not work? How do you have the submit buttons setup?
  18. It really doesn't matter where $act comes from. This variable is being used from within the `proses_user.php' script and has nothing to do with the HTML form. Being as he's using the variable within a switch, that relies on $act equaling 'euser', it's quite possible the problem laid with the $act variable. Ha. However, that's probs the problem. I missed it on my first scower of the code.
  19. Well yeah if he really wanted to, but that would require double the amount of fields. As you can see from his code though that's not what he was after.
  20. No you can just use two submit buttons, but give them a different name so you can identify which was pressed. For example: <form ...> <input type="submit" name="return" value="Save and return" /> <input type="submit" name="next" value="Save and move on" /> </form> if (isset($_POST['return'])) { // ... } elseif (isset($_POST['next'])) { // ... } Only the button that was clicked will be posted.
  21. Are you seeing "Your First Name:"? Where does the $act variable come from?
  22. As salathe said there isn't with a single call to rand(), but you could use something like: $ranges = array( 0 => array(1000, 1025), 1 => array(2000, 2025), 2 => array(3000, 3025) ); $n = array_rand($ranges); echo rand($ranges[$n][0], $ranges[$n][1]);
  23. If he's only touched the basics of programming (in whatever language) how would ever know to type in 'process instantiation' or anything of the sort? It's not even so much what you say just way you blurt it out like you've changed his life or something.
  24. Using document.write() basically blanks the page when called in that way, so taking your styles with it. I'd recommend not using document.write() anyway, look into replacing the content of a div, span or another element with the ".innerHTML" property.
  25. The error is trying to tell you the second parameter isn't an array (which it needs to be). At a guess I'd say that the first query isn't returning any results and so the $sendtouser array isnever being populated. Declare the array before you loop through the results, so even if it's empty, it's still an array when it comes to your in_array() condition: $sendtouser = array(); while($row = mysql_fetch_array($result)) { $sendtouser[]=$row['ip']; }
×
×
  • 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.