Jump to content

bundyxc

Members
  • Posts

    279
  • Joined

  • Last visited

    Never

Everything posted by bundyxc

  1. Thank you very much, I'll probably shoot you an email in a month or two, when I get the time to write up a quality tutorial.
  2. I'd like to write up a tutorial, and apply for it to be posted on phpfreaks.com, is that possible?
  3. Output: Array ( [0] => Array ( [0] => {template:title} [1] => {template:header} [2] => {template:paragraph} ) [1] => Array ( [0] => title [1] => header [2] => paragraph ) )
  4. I'm looking throughout an entire HTML document for something in this format: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title><!--{template:title}--></title> <link rel="stylesheet" type="text/css" href="my.css"> </head> <body> <h1><!--{template:header}--></h1> <p><!--{template:paragraph}--></p> </body> </html> I'd like to look through the file, and have matches of: title, header, paragraph. What's the code I would use to do this? I was using this: \<!--{template:(.*)}--> But unfortunately, that simply matches the entire HTML comments. I'm assuming that this has to do with lookarounds. Any suggestions?
  5. Check out the notes at rand if you're looking for a function to do it for you. A couple hours ago I added the genRandStr() function to php.net as a note, but I'll post the function/documentation here for you, while they update their mirrors. To make a ten digit string, you'd just use: genRandStr(10,10,1,1,1) Manipulating the last three 1's to zeroes will change if it uses lowercase, uppercase, and numbers (respectively). Right now, the above function will create a single ten character string, using uppercase, lowercase, and numbers.
  6. Let's say that I have a code that gets form input in the form of an equation as a string. How would I make my program do this equation? <?php $input = '2 + 2'; //$input is a string $result = 2 + 2; //I'm not sure how to take the string and put it into equation form. print($result);
  7. You know what I mean. Although I'd be afraid of restarting the internet. I was born in the early nineties, so I didn't see the worst of it.. but seeing a geocities site for the first time was still a moment I'll never forget.
  8. Probably starting from scratch.
  9. So I was on another thread, and I saw this line of code: echo ($page > 1) ? '<a href="?page=' . ($page - 1) . (strlen($search) ? '&search=' . $search : '') .'">prev</a> ' : 'prev '; Anyway, could somebody explain what relevance the first and last question marks have in this line of code? Obviously the middle question mark is passing a HTTP GET request onto the linked page, but I don't understand the question marks (or the colon at the end, either). Thanks for your time.
  10. Well, your file could look this this: [MON/1830/Event1] [MON/0700/Event2] [TUE/1200/Event3] [WED/0000/Event4] [THU/2234/Event5] [FRI/1100/Event6] [sAT/0333/Event7] [sUN/0001/Event8] [FRI/2359/Event9] [WED/2359/Event10] [sUN/2359/Event11]
  11. So you have a bunch of files, like monday.txt, tuesday.txt, etc? I think this would be easier to do with either one text file, or with a database. Are either of those an option?
  12. I believe if you set it to zero seconds it will wait until the full page has loaded.
  13. Try this: include_once ("/auth.php"); include_once ("/authconfig.php"); include_once ("/check.php");
  14. Headers are sent upon the first character of code to be echoed, so any header modification must be done beforehand.
  15. You most likely won't notice the difference either way, but my knowledge over the topic isn't very expansive. However, these guys seem to know what they're talking about.
  16. You should be able to find what you're looking for in the PHP Directory Functions.
  17. Please post the HTML for the form.
  18. Are you looking for pageviews, or for visits? If you're looking for pageviews, then you'll probably have to accept that a dumb user will be able to do that (unless you want to try to code a script measuring the times between refreshes, and recognizing if it's malicious or not). If you're looking for website visits, I'd do something like this: check to see if IP address is found in database; if IP is not found in database { insert into database with current time and IP; add one to counter; } Then, every hour or so, run a query deleting all visits more than a day old. (Probably using cron jobs).
  19. If all of the data is related, I don't see why you'd need to use two tables. By the way, this topic should have been posted in the MySQL section. I'm sure a friendly neighborhood mod will move it for you though.
  20. I've seen that before, but the dumb admin decided to make it longer words. If I ever go to any of your sites, and I see a question like "What's 'ENCYCLOPEDIA' spelled backward?" for your CAPTCHA, I will never talk to you again. :l P.S. For the record, it's 'AIDEPOLCYCNE'.
×
×
  • 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.