Jump to content

lococobra

Members
  • Posts

    81
  • Joined

  • Last visited

    Never

Everything posted by lococobra

  1. Sounds to me like you're trying to do regex stuff... but I don't exactly see the point. Is the string going to change? Or are you just trying to do this for that one specific example... I'm sure I could help more if you were being more specific... but... well... here goes nothing. <?php $string = 'The dog [verb]jumped[/very] high'; $results = array(); preg_match_all("/\[.*?\](.*?)\[\/.*?\]/", $string, $results); $results = $results[1]; print_r($results); ?> Thats the best I can do with what what you gave me.
  2. Well, I wasn't going to post because I thought my suggestion would violate all kinds of standards, turns out it doesn't (See Here for proof) I think if you get rid of your <form> it will solve most of your problems. When doing ajax, you often need form elements to be dynamic. However, when using a form this is not the case... after the form has been submitted, it kind of locks up. Seems like you know what you're doing so I won't go into too much detail, just get rid of the form and use something like this to check the entered values... <input type="button" onClick="checkLogin();" /> Try that and I'll try to remember to check back here to see if that fixed it.
  3. So lets say I have some code such as... echo "test"; //here's some stuff i dont want to see echo "okay"; //other stuff echo "blah"; /* and a multi line comment That ends */ here This code is contained in $code Then I run this on it.... $code = preg_replace("/(\/\/)(.*?)([\n\r])/", '', $code); $code = preg_replace("/(\/\*)(.*?)(\*\/)/", '', $code); And it becomes... echo "test"; echo "okay"; echo "blah"; /* and a multi echo "text"; line comment That ends */ here Could someone tell me how to fix the pattern of the 2nd one?
  4. Is there a way in php or html to change the referring URL that an image carries with it? Example: could I display an image at my web site, but when it was accessed, have it look like its coming from a different web site?
  5. keeB: thanks me making me feel like an idiot, and completely solving my problems :P btw, im only 15 years old... so it's kind of understandable that I would have some problems.
  6. www.lococobra.com/blender/chat.php is the page I'm having issues with. The page allows you to post your own comments and such, the problem is... once the form is filled out and put in my database... it comes back with no spacing (new lines are not viewed), and every ' has a / before it. These are probably issues with the way I'm doing the coding... so here's a shortened explination... Chat.php (mainpage) calls entries.php (parser) which imports chatlog.php (database) entries.php figures out where all the entries should be, and assigns links for multiple pages if there are more then 10 entries. When you make a post, posting.php makes a copy of chatlog.php and then inserts a new entry in it (from the form information collected). Then you are forwarded back to chat.php, which displays the new entry. Sorry, but I can not post the PHP because it is 100% coded by me, and I dont really feel like giving it away. However, I am happy to answer any question about specific parts of my code. Thanks.
×
×
  • 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.