954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Lyrics Script - Help me creating a submit.php to sumbit new lyrics

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

smartness
Junior Poster
103 posts since Aug 2007
Reputation Points: 7
Solved Threads: 14
 

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.

chmazur
Light Poster
30 posts since Sep 2007
Reputation Points: 10
Solved Threads: 3
 

it doesnt matter if someone makes the script for me or tells me how to do...

u can download the script @ http://lyrics.whdot.com/sscript.zip

the point is to get this done...

smartness
Junior Poster
103 posts since Aug 2007
Reputation Points: 7
Solved Threads: 14
 
fatihpiristine
Posting Whiz in Training
283 posts since Sep 2007
Reputation Points: 6
Solved Threads: 19
 
:)


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

smartness
Junior Poster
103 posts since Aug 2007
Reputation Points: 7
Solved Threads: 14
 
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??

fatihpiristine
Posting Whiz in Training
283 posts since Sep 2007
Reputation Points: 6
Solved Threads: 19
 

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

smartness
Junior Poster
103 posts since Aug 2007
Reputation Points: 7
Solved Threads: 14
 

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.

raphie
Light Poster
44 posts since Jun 2009
Reputation Points: 13
Solved Threads: 4
 

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

smartness
Junior Poster
103 posts since Aug 2007
Reputation Points: 7
Solved Threads: 14
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You