Jump to content

battleroyalex

Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

battleroyalex's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Can someone help me with a php code that loads files from a folder and then prints out a url like this [code]www.mydomain.com/video?name="filenamehere"[/code] I don't even know where to start please point me in a direction, thanks guys
  2. [!--quoteo(post=361958:date=Apr 5 2006, 11:10 AM:name=ToonMariner)--][div class=\'quotetop\']QUOTE(ToonMariner @ Apr 5 2006, 11:10 AM) [snapback]361958[/snapback][/div][div class=\'quotemain\'][!--quotec--] google 'bbcode' - that should provide a tutorial somewhere. What you are actually doing is a series of string replacements when printing the string - so [b] becomes<b> etc. etc. I use regulat expressions to do this but they have taken me a couple fo days to learn to a level where I can use them to there full extent - to start with str_replace will do but you will find sometime down teh line that they are not pwoerful enough for what you want. [/quote] I did google bbcode and all I get is how to edit forum bbcode and other useless stuff. I can't find anything on making your own.
  3. [code]How would I disable html and make tags like they have on the forums for my comment script? Like if i wanted <b> to be [bold] ect.[/code] Currently this is the code I need to implement this into: [code]<head>    <title>Comment Page</title>    </head>    <body>    <?php // comment.php    include 'displaycomments.php';    //error handeling    ini_set ('display_errors', 1);    error_reporting (E_ALL & ~E_NOTICE);    if (isset ($_POST['submit'])) {//handel the form.    //connect and select db    if ($dbc = @mysql_connect    ('localhost', 'thegamegraal', '*******'))    {        if (!@mysql_select_db ('battleroyalex'))        {            die ('<p>Could not select the database because: <b>' . mysql_error() . '</b></p>');            }        }else {              die ('<p>Could not connect to mysql because: <b>' . mysql_error() . '<b></p>');              }        // Define query        $query = "INSERT INTO comment_entries (comment_id, name, comment, date_entered) VALUES (0, '{$_POST['name']}', '{$_POST['comment']}', NOW())";        //run query        if (@mysql_query ($query)) {        print '<meta http-equiv="refresh" content="0"><p>your comment has been added.</p>';        }else {        print "<p>could not add comment because: <b>" . mysql_error() . "</b>. The query was $query.</p>";        }        mysql_close();        }        ?>[/code]
  4. I currently have an image uploading system but I need to add a line of code into it to resize the images width to 600 and delete the old image. Current Form: [code]<form enctype="multipart/form-data" action="uploader.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Choose a file to upload: <input name="uploadedfile" type="file" /><br /> <input type="submit" value="Upload File" /> </form>[/code] Current Uploader.php: <?php [code] // Where the file is going to be placed $target_path = "uploads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {     echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{     echo "There was an error uploading the file, please try again!"; } ?> [/code] Its a very simple script im really new at this can someone fix it up to resize the images to 600 width :(?
×
×
  • 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.