Jump to content

tibberous

Members
  • Posts

    1,187
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by tibberous

  1. Right now, the script I wrote creates a table for each individual user. Is that okay, or is it better to put all the users data into a single table, and add an id field to it assign it to the different users?
  2. Yeah, thats the way you want to go. Check out my site: http://www.flashgamereviews.com/ All the pages show up as html pages in the main directory, in actuality they are all calls to index.php, which then uses the request uri to output the correct page. It also uses mod_rewrite to protect the directories that hold the sites code. The basic rule looks like this: RewriteRule ^([A-Za-z0-9-!])+\.html$ index.php RewriteRule ^([A-Za-z0-9-!])+/([A-Za-z0-9-])+\.html$ index.php
  3. Just to organize it more, and because the contact data isn't used very often. That worked, thanks. Isn't there also a way to do it with subqueries? I'm trying to get better at mysql, since for a long time I have just used the minimum statements and done all the processing with PHP.
  4. I have two tables, one called users and one called contact. They both have a field called id, with a one to one relationship. Ex: Users: id Name 6 Trent Contact: id PhoneNumber 6 555-555-5555 I want to make a select query to grab the name with the id of 6, and the phone number with the id of 6, but I forget how. Can someone help me out? Thanks
  5. $search = array(chr(226).chr(128).chr(156), chr(226).chr(128).chr(157)); $replace = array('“', '”');
  6. I have a textarea, and am trying to get it to convert left and right facing quotes into “ and ” I figured I could do this with str_replace, and it seemed to work on windows. but not on linux, Does anyone know how to do this?
  7. I have a script that makes files and folders. The problem is that it makes them with permissions that don't all my ftp access - meaning I have to write a script to chmod everything, then run it. I am going to change the script to chmod everything, but is there some way I can set my script to either make files as 777 by default? Or have the script run as me somehow?
  8. It's like everyone quit posting, and traffic is the lowest it has been in three months.
  9. Move the first one below the second one. From then on, refer to it as the second one.
  10. It works for me - do a phpinfo() and make sure your running 5, because theres nothing wrong with the code.
  11. Of all the things in programming, I would say mod_rewrite is one of the least logical, hardest to use things out there. I use it all the time, it's great for a lot of things - but it is just so quirky, and the windows version works different the the linux version, so I'm always getting 500 errors after I ftp.
  12. Yes, you can. Should be, RewriteEngine On RewriteRule ^forum/imagehosting/(A-Za-z0-9)+\.jpg$ notfound.jpg Something like that anyway
  13. I had the same problem on my site: http://www.flashgamereviews.com/ The solution: <base href="http://www.your-url.com/"> There is a bug in FF where background doesn't use it right, but background-image: url doesn't have that problem.
  14. Chantown is technically right. That said... Lets say I have a string. The string is like: "test,test2,test3,test4" To get it apart, all you need to do is: $answers = explode(',', $string); And now all the answers are in an array, and all the commas are gone. And to find out how many you have, you can just go count($answers) And to put them back together as a string, it: $string = implode(',', $answers) The biggest problem you are going to have is escaping the separator (IE:The answer is: Earth, Wind and Fire). The best way around this would probably be to just str_replace all ',' with ','.
  15. <?php $con = mysql_connect("localhost","peter","abc123"); if (!$con) { die(mysql_error()); } mysql_select_db("db", $con); $result = mysql_query("SELECT * FROM person"); if(mysql_num_rows($result)){ while($row = mysql_fetch_array($result)) { echo $row['FirstName'].'<br />'; echo $row['LastName'].'<br />'; } } else { echo "A Hax0r St0l3 0ur Namez!!!!"; } mysql_close($con); ?>
  16. Maybe, but it could just be remade without the URGENT in all caps after it. It's a stupid, simple question, asked rudely, but that doesn't really make it lockable.
  17. Just you can't really be pushy when asking for free help - I mean, you can be, but you generally don't want to be.
  18. file_get_contents() is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by your OS to enhance performance.
  19. Are you wanting a code only method? If you are on linux you can use `` to execute the zip command in shell.
  20. This isn't remotely urgent. Urgent is like, I'm on the front page of digg and my CMS is dead - this is just an update you are thinking about doing...
  21. Is there any way to use PHP to get the default directory index? Either in general or just on Apache? For example, my server is set to serve index.php before index.html. Is there a way I could use PHP to know that index.php was my default index?
  22. I don't want to put ads on my personal site, but I was thinking of selling the demo video inside my FLV player. This is the newest, just released version. http://www.trenttompkins.com/Downloads/Open-Source-FLV-Player-2-RC1.html The site gets 4k uniques a months, 9k pageviews. The page for the FLV player has gotten 7,200 hundred hits this month, the site is #438,698 in Alexa. The traffic is 100% organic, virtually all programmers and web designers - I was thinking it would be the perfect spot to advertise a script, or web service, or maybe hosting. Does anyone know I'd go about selling this? I was thinking of offering it to people who write PHP scripts, but I don't use any PHP scripts.
  23. My traffic comes mainly from forums, hot scripts, delicious and google. I only get about 150 visits a day, but it stays pretty constant. I think a lot depends on what your site does. If you write ground breaking technology articles, try to make digg. If you make videos, watermark them and send them off to youtube. If you make free software, post about it on forums and put links to your site in it. You could get some spam bots, the kind that are made to hit all phpbb / smf / vbulletin boards, and you just have to make the message and punch in the captcha. Or release a facebook app / firefox / joomla extension, or an embeddable Flash thing people can put on there sites. Make sure all your links are SE friendly, and don't have multiple different links to one page (ie: homepage.html and home/ and home/page.html) I think the biggest thing is making people want to be at your site, and search engines. I'd give a ball to be on the the front page of google for even a moderately good term, as it stands I'm #3 for "open source flv player", but that isn't very good.
×
×
  • 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.