Jump to content

sarathi

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

sarathi's Achievements

Member

Member (2/5)

0

Reputation

  1. I added that in but it did not return any errors.. But the script is now saying that it did upload the file, but it is not showing in the images folder..
  2. I am using this code to upload files to my web server: <?php $target = "images/"; $target = $target . basename( $_FILES['uploaded']['name']) ; $ok=1; //This is our size condition if ($uploaded_size > 350000) { echo "Your file is too large.<br>"; $ok=0; } //This is our limit file type condition if ($uploaded_type =="text/php") { echo "No PHP files<br>"; $ok=0; } //Here we check that $ok was not set to 0 by an error if ($ok==0) { Echo "Sorry your file was not uploaded"; } //If everything is ok we try to upload it else { if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else { echo "Sorry, there was a problem uploading your file."; } } ?> <form enctype="multipart/form-data" action="uploadform.php" method="POST"> Please choose a file: <input name="uploaded" type="file" /><br /> <input type="submit" value="Upload" /> </form> It all works fine up until the move_uploaded_file(), at that point it won't move the file from the temp directory into my images folder.. I have set the permissions to read and write for the images folder, so I'm not sure what else I can do to make this work...
  3. I'm not sure of any other way to find a word in a string. Is there any other way other than regular expressions?
  4. I am trying to make a search engine with preg_match(), so far I have the search go through as 'post', and then I explode it $search=explode($_POST['search'], ' ') by spaces, and I try to match that to the body of each post with preg_match($search, mysql_result($body, $i)) the mysql_result returns the right post. But it doesn;t seem to be matching anything.
  5. I was just wondering if anyone knew what the font is is that's used for code snippets on php.net?
  6. Well, say I have the string "hello name my Gname is name" I already have all instances of name turn blue with ~name~ >> <font color='blue'>name</font> but I want name to only be replaced if there are no G's before it on the same line.
  7. I am trying to replace a symbol if 'G' is not found before the character on the same line. I am trying to use this: ~(?<!G)({|}|,|\(|\))~ But this only works if 'G' is right before the character. How could I allow for space after the 'G'.
  8. Thank you for your help, I changed the code a bit to fit my needs: '~\$([a-z]*?)(?![a-z])~' But I'm wondering how I can add a-z and 0-9?
  9. I was wondering how I can replace a word, starting from a $ sign, until the first space after it?
  10. I found that a negative look behind is ?<! and a negative look ahead is ?!, but I can't find the right way to implement them into my code. /(?<!\[(code|html|css|javascript|php|gml)\])(.*)(\[b\])(.+)(\[\/b\])(.*)(?!\[\/\\2\])/Usi I've tried this, and few other ways, but I none of them have works, does anyone know how I could correctly implement them to check if there is not a code tag before, and there is not a /code tag after?
  11. Nvm, I figured out that I can use [/\\2] instead of to match the first tag.
  12. Nvm, I found a way to apply tag only when code is not around it.
  13. I have this regex code to use with preg_replace();, It's part of an array. '/(\[code|html|php|css\])(.+)(\[b\])(.+)(\[\/b\])(.+)(\[\/code|html|php|css\])/Usi', and I'm wondering if it is possible to make it so the opening and closing tags e.g.(code|html|php|css) have to match for this to work?
  14. so I have for my div .test { font-family:courier,verdana; color:blue; font-size:12pt; } <div class="test">test text</div> but the page is dynamic, and sometimes there might be <strong> or <em> tags around the div, but I don't want the html tags to change the text in the div. Is this possible? 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.