Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8455775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:22:16+00:00 2026-06-10T12:22:16+00:00

<?php include (apps/controller/database.php); include (header.php); //Connect to the DB $database->connect(); //Check the url has

  • 0
 <?php

include ("apps/controller/database.php"); include ("header.php");
//Connect to the DB $database->connect(); //Check the url has been set
if ($_SERVER['REQUEST_METHOD'] == 'POST') {


$url = isset($_POST['url']) ? $database->escape($_POST['url']) : false;
//$url = isset($_POST['url']) ? $database->escape($_POST['url']) : '';
//This is optional ;)
$password = isset($_POST['password']) ? $database->escape($_POST['password']) : '';
//Okay, now we've figured out if they've set the url, let's add it to the DB
if (isset($url)) {
    $id = md5(uniqid());
    $res = $database->query("INSERT INTO urls (url,pass,key) VALUES('".$url."','".$password."','".$id."')");
    echo '<br /><br /><div id="both" class="types both"><a href="http://localhost/view.php?id=' .
        $id . '">http://localhost/view.php?id=' . $id . '</a></div>';
}
//Close the DB
$database->close();
}else
{
    echo '<br /><br /><div id="err" class="notification error"><a class="close" href="#" alt="close" title="Close this notification"> </a> You cannot view this URL directly. Please create a url.</div>';
}


$database->close(); 

My MYSQL structure is: id, url, views, keys

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:22:17+00:00Added an answer on June 10, 2026 at 12:22 pm

    key is a MySQL reserved keyword, you need to quote it with backticks if you want to use it as a field name.

    INSERT INTO urls (url,pass,`key`)...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a site where the pages have the following structure: <?php include('header.php'); ?>
Following structure: apps/backend/ apps/frontend/ modules/ account/template/_menu.php account/template/test.php settings/template/indexSuccess.php I do include _menu in test.php
When i use php include to include a page in my website all the
This is user.php: include(databse.php);//retrieving successfully first name and lastname from databse file into user.php
In my live site I have php include() and require() that have full path
<?php include ../music/php/logic/core.php; include ../music/php/logic/settings.php; include ../music/php/logic/music.php; $top = At world's end; // create
I have a php file that looks like this: <?php include(config.php); // put the
Here is example which I have try <?php include 'spider/classes/simple_html_dom.php'; $html = new simple_html_dom();
I have a very simple script that creates a user: <?php include 'mysqlserver.php'; session_start();
I'm trying to link to an external stylesheet using this code: <?php include(/homepages/9/myusername/htdocs/Mobile_Detect.php); $detect

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.