Jump to content

No Title Yet.....


tarun

Recommended Posts

This A Quick Bit Of PHP Code Which I Have Just QUICKLY Made For Another PHP Freaks Forums User

Can You Please Check Through It - It Is Currently Outputting An Error!

 

 

<?php
$addform = '<form action="$PHP_SELF" method="post">

Video URL:<BR><input type="text" name="url" size="40">

<br>Video Description:<br><textarea rows="10" cols="30" name="desc"></textarea><br></form>

<input type="submit" value="Add Video">'

echo '$addform';

if (isset($_POST['Submit'])) {


$url = $_POST['url'];
$desc = $_POST['desc'];

if(empty($url)){
echo 'Please Specify The URL Of The Video<br>';
}

elseif(empty($desc)){
echo 'Please Specify A Description Of The Video<br>';
}

else{
$newcontent = '<videos>
<video url="$url" desc="$desc" />
</videos>';
$previouscontent = file_get_contents("videoplaylist.xml");
$openfile = fopen("videoplaylist.xml", "w");
$totalfile = $previouscontent.$newcontent;
fwrite($openfile, $totalfile);
fclose($openfile);

echo 'File Added To Playlist<br><br>Add A New File?<br>$addform';
}


}
?>

 

 

Thnx,

Tarun

Link to comment
https://forums.phpfreaks.com/topic/43022-no-title-yet/
Share on other sites

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.