Jump to content

formasfunction

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

formasfunction's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I think it must have been a line break issue because I manually retyped the entire script in VIM rather Textmate and it worked.
  2. I'm trying to set up email piping on my server and I'm getting the following error back in my email: /bin/sh: /var/www/vhosts/example.com/httpdocs/mailcontroller.php: /usr/bin/php : bad interpreter: No such file or directory I think the mail alias I set up in qmail is working correctly because when it wasn't I didn't get a script error back, just a user not found error. From the error it sounds like it's not able to find php but I've tested a script from the command line to that path and it works fine (php is running as CGI btw, rather than CLI). I'm guessing that it's making it all the way to mailcontroller.php because I don't have the /usr/bin/php path anywhere else but in that file. Could it be that it's actually running the script but can't get to stdin? Any help would be greatly appreciated. I'm running PHP Version 4.3.9 on a linux box with Plesk 8.2
  3. I'm not exactly sure how to write the actual recursive function that will take an array returned from a MySQL table named COMMENTS with the following columns: id comment parent_id timestamp Comments without a parent_id are top level and ordered by the timestamp. However, any comment with a parent_id will need to be ordered under the comment who's id matches the parent_id, secondarily by it's timestamp. A straight loop won't allow me to take the parent_id's into account. I'd like to do it all with just one hit to the database.
  4. It's not the html or css formatting of the comments that I need help with, it's writing a function that correctly cycles through comment ids and identifies child comments, placing them in the correct order.
  5. I'm looking for a simple tutorial on how to create a comment section for a website that allows users to reply to previous comments, indenting them much in the same way a site like slashdot does. I have a working script for a simple list but I'm not sure how to write a recursive function to deal with the rest of it. I've done quite a few searches for previous solutions but I get the feeling I'm not using the right terms. Any help would be greatly appreciated.
  6. I have the following RewriteRule working within an htaccess file in the root directory of a site: <IfModule mod_rewrite.c> Options FollowSymLinks RewriteEngine on RewriteRule ^direct/(.+) /index.php?q=$1 [L] </IfModule> I'm trying to get it to work without the need to reference the directory "direct" on the first part of the rule and instead reference the root: RewriteRule (.+) /index.php?q=$1 [L] For some reason it's not working as expected. I know that if you're referencing the folder in which htaccess resides then you don't need the leading "/".
  7. Thanks effigy, that works great. Am I doing my backreference correctly in $replacement?
  8. Sorry, I don't think I was clear enough. I don't want to change the class of the body, I want to find the opening body tag regardless of whether or not it has a class attached to it and add a chunk of code after it. If it was always a predictable tag (like always just <body> with no class) then I'd use a str_replace and append my new code at the end.
  9. I'm trying to write a regular expression that will take a chunk of html and modify the body tag but I'm having trouble as this is my first regex attempt. Here's what I have: $_response_body = whatever html I'm feeding in $pattern = '<body \b[^>]*>'; $replacement = '\\1 <div id="top_frame"><div id="nav_bar">text</div><div id="sub_bar">text</div></div>'; echo $_response_body = preg_replace($pattern, $replacement, $_response_body); So I'm hoping that this would take something like <body class="home"> or <body class="main"> and turn them into: <body class="home"><div id="top_frame"><div id="nav_bar">text</div><div id="sub_bar">text</div></div> or <body class="main"><div id="top_frame"><div id="nav_bar">text</div><div id="sub_bar">text</div></div> Thanks in advance.
  10. I would like to be able to accept the first 10k of a file and then cut it off there. My hope is that I can grab the beginning of an MP3 file and read the ID3 tag (assuming its prepended) rather than waiting for the entire file to upload and grab the tags. Is there a "cap" or limiter that you can put in? I don't mean the type that refuses to accept a file of a certain size.
×
×
  • 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.