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 8782249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:31:22+00:00 2026-06-13T20:31:22+00:00

I use this following codes to make new users in website. it’s like sign

  • 0

I use this following codes to make new users in website. it’s like sign up page. it’s working perfectly in localhost and data will insert to the database and the table but now in the server it won’t work.

  $code = rand(11111,99999);
    $link1 = mysql_connect("http://www.mysite.com","username","password");
     mysql_select_db("username");
     mysql_query("SET character_set_results= 'utf8' , character_set_client = 'utf8' , character_set_connection = 'utf8',
     character_set_database ='utf8', character_set_server = 'utf8' ");
     mysql_query("INSERT into user(name,family,email,gender,username,pass)
     values('$_POST[name]','$_POST[family]','$_POST[email]','$_POST[gender]','$_POST[username]','$code')");
     mysql_close($link1);
     //connection user pass
     $link2 = mysql_connect("http://www.mysite.com","username","password");
     mysql_select_db("username");
     mysql_query("INSERT into joinuser(username,pass,permission)values('$_POST[username]','$code','user')" );
     mysql_close($link2);

It inserts the values in localhost but it won’t work in the server.

It’s php with mysql database.

Any help will be appreciated.

  • 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-13T20:31:27+00:00Added an answer on June 13, 2026 at 8:31 pm

    "http://www.mysite.com" is wrong. You cannot connect to MySQL using HTTP.

    In most cases, you will only ever need to use localhost and allow the library to connect via a local socket rather than TCP/IP.

    If you are connected to a database server running on a different machine to the HTTP server, then you would use the hostname (and optionally the port). You wouldn’t specify a URL scheme of any kind.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm starting to use Role Management in my website, and I'm currently following this
(Programming Language: PHP v5.3) I am working on this website where I make search
To use custom layout file in my app I'm using this following code, set
Following this question , I use this function to convert arrays to objects, function
I have following Image as src in ImageView. I use this as background image.
I was following this tutorial . I need to use a php file's ouput
I'm trying to use Youtube apis in my web application by following this guide
I'm trying to use the Facebook assemblies in ASP.NET MVC 3. I'm following this
I use the following jquery statements but i get error in this function onGetDataSuccess(result)
I use the following bash script to copy only files of certain extension(in this

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.