Append Data on post

I am very new to PHP.

I am trying to modify to do what I want.

What I want, is when the user types in the URL and hit submits, it appends something at the beginning of the URL.
Example, this is not what I want, but it will demonstrated. Pretend the URL the user enters is:”.
I want the script to save it in the database as:

Here is the code from the submit section of the script:


Type the new page data:

Title (5-100 characters)
Description (0-200 characters)
Keywords (0-200 characters)

I do not know if it should be done there, or somewhere else? As it would be nice to not have to do anything to the MySQL database, and just have it send the correct information.

The user has to submit the form before you can process it in PHP. Don’t try to do anything in the VALUE tag of the input field. You can do it with javascript before the form is submitted if you want. Either way would work.

To do it in PHP when the form is submitted this is what you do…

The form:

<P>Type the new page data:<P>
<FORM METHOD="post" ACTION="admin_edit_page_add.php">
Enter Url:&nbsp;<INPUT TYPE="text" NAME="url" MAXLENGTH=300><BR />

Then in admin_edit_page_add.php do this…

// this appends text using the dot character
$url = "" . $_POST['url'];
// now do your database update with $url
Sponsor our Newsletter | Privacy Policy | Terms of Service