I have downloaded a lyrics script, and that works, but the author of that script didnt create a file for submiting lyrics...

i have tried to create a script but im not a php pro so i ask help from daniweb, to help & create that ""submit.php""...

the one who does this will have a lifetime linkback in all my sites...

now here is the script, if anyone wants to download abd test...

Download:

http://lyrics.whdot.com/sscript.zip

this is the sql that u have to execute on your db if u want to run the lyrics script

CREATE TABLE `lyrics` (
  `id` int(5) NOT NULL auto_increment,
  `title` varchar(250) NOT NULL default '',
  `artist` varchar(250) NOT NULL default '',
  `album` varchar(250) NOT NULL default '',
  `lyrics` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;

-- --------------------------------------------------------

-- 
-- Table structure for table `submit`
-- 

CREATE TABLE `submit` (
  `id` int(5) NOT NULL auto_increment,
  `artist` varchar(255) NOT NULL default '',
  `title` varchar(255) NOT NULL default '',
  `album` varchar(255) NOT NULL default '',
  `lyrics` text NOT NULL,
  `comments` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM ;

now submit.php needs these fields
Artist (text box) ---> `artist`
title (text box) ---> `artist`
album (text box) ---> `album`
lyrics (text area) ---> `lyrics`
sumbiter (text box) ---> `comments` (or create a new column `sumbiter`)

---> = this info goes to column

this is not that hard... i tried but i didnt succes

Hi Smartness! You are looking for someone who makes the work? or you want learn how to do the submit script?
Can you share and explain the script that you have tried to create? Then we can help you and you`ll learn.

:)

Hey fatih, nese ki naj send me ndihmu mir, nese jo mos fut smile pa lidhje... se une jem to prit per pergjigje... e jo pa lidhje

Hey fatih, nese ki naj send me ndihmu mir, nese jo mos fut smile pa lidhje... se une jem to prit per pergjigje... e jo pa lidhje

what language is it??

i said, if u dont know how to help me, u don have to post a smile--- i thaw u are albanian (my name is fatih too, and pristina is a city in kosovo - albania)

sorry for the chit-chat...

if you create a form to submit with all the fields need it the code you need for php to communicate with the db and insert the info is...

Need to create a variable to enclosed the query... and set all the columns you want to insert data and use global variable populated by the form...Important!... the form method should be set to 'GET'

$insert_info_sql = "
INSERT INTO `table-name` SET `artist` = '".$_GET['artist']."';
";

Next is the php function to execute the query...

mysql_query($insert_info_sql) or die ('Error Message');

As you notice the mysql_query function enclosed in parenthesis the varible created.. that holds the query to be executed.

That's it... just remember to separate each column with a comma in the query...

Example:

SET `artist` = '".$_GET['artist']."', `lyrics` = '".$_GET['lyrics']."',

I would like to help you with this but I have to leave my office for a week and I don't think you can wait that long...

hopefully this help...

Sorry I forgot the HTML form code... is this one..

<?php
//enclose here the code I mentioned before
?>

<form method="get" name="lyric_submit" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<!-- for each column you will do the same as follow -->
<input name="artist" value="" />
<!-- for the text area for the lyrics -->
<textarea name="lyrics" cols="60" rows="25">
</textarea>
</form>

<!-- Just remember to match the name for the inputs and textareas with the globals $_GET[''] -->

I hope this works for you.

Thanks Raphie, but this thread is to old, and i have more knowledge in php now, but in fact I didn't continue that script cuz i got stuck!

So thank you very much for your time...

(as for me) Mods can close this thread..

This question has already been answered. Start a new discussion instead.