Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PHP problem

Featured Replies

Ok the problem i am having is that i am creating a registration page for a members area, but i can't get the registration form working, i don;t know if there is an error in the code or if it is just not connecting but it doesn't seem to work and i can't figure out what the problem is.

 

this is the code i have

 

<?php

mysql_connect("https://phpmyadmin-dublin.purplecloud.com/", "username", "password") or die(mysql_error());

mysql_select_db("Database_Name") or die(mysql_error());

if (isset($_POST['submit'])) {

if (!$_POST['username'] | !$_POST['pass'] | !$_POST['pass2'] ) {

die('You did not complete all of the required fields');

}

if (!get_magic_quotes_gpc()) {

$_POST['username'] = addslashes($_POST['username']);

}

$usercheck = $_POST['username'];

$check = mysql_query("SELECT username FROM users WHERE username = '$usercheck'")

or die(mysql_error());

$check2 = mysql_num_rows($check);

if ($check2 != 0) {

die('Sorry, the username '.$_POST['username'].' is already in use.');

}

if ($_POST['pass'] != $_POST['pass2']) {

die('Your passwords did not match.');

}

$_POST['pass'] = md5($_POST['pass']);

if (!get_magic_quotes_gpc()) {

$_POST['pass'] = addslashes($_POST['pass']);

$_POST['username'] = addslashes($_POST['username']);

}

$insert = "INSERT INTO users (username, password)

VALUES ('".$_POST['username']."', '".$_POST['pass']."')";

$add_member = mysql_query($insert);

?>

 

 

<h1>Registered</h1>

<p>Thank you, you have registered - you may now login</a>.</p>

 

Is there anyone who could please help me with this issue

Ok the problem i am having is that i am creating a registration page for a members area, but i can't get the registration form working, i don;t know if there is an error in the code or if it is just not connecting but it doesn't seem to work and i can't figure out what the problem is.

 

this is the code i have

 

 

 

Is there anyone who could please help me with this issue

 

is this externally hosted? If not, try typing 'localhost' instead of https://phpmadmin-blah.........

  • 1 month later...

PHP's error_reporting is a wonderful tool, learn to use it.

 

Try doing this:

error_reporting(E_ALL);

 

at the top of the page, do a string replace for any @ symbols in the script, run it, and tell us the output.

ok, heres a chance. You are using | rather than || for OR in your IFs

 

generally speaking, if its in an IF then it will be two chars long.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.