Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Sep 2013
    Posts
    3
    Member #
    37154

    Database Creation Help

    I've been recently working on creating my own URL shortener for my old website (not in existence anymore), but I figure I could maybe use it in the future on my current site or eventually register a special domain for it. I don't have very much knowledge on PHP, and none at all for MySQL, and that's where I've been having the issue with it as the basic code I'm using can cause glitches if the same "short URL" is entered. I need to develop a database for the short URLs that have been submitted, so they can't be used a second time.

    I have a beta version of this script still, done with a few different files with a simple PHP code to submit a URL and a script/page to display all the URLs that have been shortened, along with the short URL that's been generated. I have a "random URL" option made with simple JavaScript to generate a random 8-character code for the short URL. A small form on the main page to enter website information like a page name/site title, the URL and the 8 digit short URL you wish to submit.

    What I'm looking to do is create a database so that if a short URL that's already on the database is attempted to be entered a second time, it'll display an error asking the user to enter a new phrase or use the random URL option. I know I shouldn't be developing these types of things without the proper knowledge for all the languages I need to use, but I figure that it's just another way to learn. May take time, but at least I don't have to spend money learning, while doing so at my own pace.

  2.  

  3. #2
    Junior Member
    Join Date
    Sep 2013
    Posts
    3
    Member #
    37154
    Any help on this? All I need is a way to create a database for "full URL," "short URL (8-char tops)," and (optional) "website name" so that way people can't enter the same short URL twice, and an error would pop up asking to choose a different short code. I need the database created along with how to enter info from the database to a page, so I can make a "links list" feature.

  4. #3
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    You're basically asking someone to code the page for you.

    You are asking for:

    • create the database
    • create the tables in the database
    • code to for a form where the user can enter a URL
    • code to compare the URL from the form to the database
    • code to send an error message to the browser if the URL is a duplicate
    • code to write the result to the web page


    About the only thing you haven't asked for is for someone to create the CSS to style it all for you.

    We are here to help - but we're not here to write the code for you. You have to at least try to do it on your own first.
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  5. #4
    Junior Member
    Join Date
    Sep 2013
    Posts
    3
    Member #
    37154
    I don't think you fully understood what I asked. I was just looking for help on how to create a database and how to use it within the site. I have pages already designed, and a simple form already made. I have whatever pages you would need, it's just the fact it creates information to a page rather than a database, so the form can't tell you if it's a duplicate and will create it anyway. Even if it can just use a flatfile database for now that can determine if there's an error with the info you enter into the form. I know it's not the most secure way, but it would be fine for now until I learn more and update it at my own pace. I guess I'm really asking for help on how to stop duplicates from being entered - in which case, this may not be the proper category anymore.

  6. #5
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    PHP MySQL Introduction

    This will get you started. That's about all the help anyone can be to you at this stage until you take this and run with it as far as you can.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:09 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com