No, I do not have a general php file.
But that's not a difficult thing.
You have the credentials of the LS database and of your database. You said both are installed on your server.
So connect to them by any MySQL library (mysqli, PDO, MeekroDB,...)
and do a "SELECT * from "lime_survey_[SurveyID] WHERE SID=[SAVEDID]"
Because the column names of LimeSurvey are the SGQA-Codes, you may map them to the column names in your database.
And insert into yours.
But anyway you should try the API.
There are a few examples here.
after the user is entering the end_url correct ?
The user does not enter the end-url. You enter the end-url to your php file with the EM parameter of the {SAVEDID} added
Best before: Have a look at the lime_survey_[SurveyID] table with phpMyAdmin or something else.
Joffm