Jump to content

making a submitted file link not case sensitive


prcollin

Recommended Posts

i have this code right now

 

<?php

if(isset($_POST['submit']))
{
    $path = $_SERVER['DOCUMENT_ROOT'] . '/userpages/';

    $file_name     = $_POST['page_title'];

    $file_contents = "<b>Email Address:</b>
<br>
{$_POST['user_email']}
<br />
<br />
<b>About Me:</b>
<br />
{$_POST['about_you']}
<br />
<br />
<hr height=\"5\" width=\"100%\">";

    //make sure the file exists and is writable first.
    if (is_writable($path))
    {
        // In our example we're opening $filename in append mode.
        // The file pointer is at the bottom of the file hence
        // that's where $somecontent will go when we fwrite() it.
        if (!$handle = fopen($path . $file_name . '.html', 'a'))
        {
             echo "Cannot open file $file_name";
             exit;
        }

        // Write $somecontent to our opened file.
        if (fwrite($handle, $file_contents) === FALSE)
        {
            echo "Cannot write to file $file_name";
            exit;
        }

        echo "Success, created $file_name";

        fclose($handle);

    }
    else
    {
        echo "The file $path is not writable";
    }
}
else
{
    echo 'Form not submitted! $_POST contents:';
    echo '<pre>' . print_r($_POST, true) . '</pre>';
    
}

?>

 

how do i make it so the new file link that is created is not case sensitive???

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.