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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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