Question: When you cant find the source of the problem When registering on HULEDET.com, users input their birthday information. The information is parsed to three columns

When you cant find the source of the problem

When registering on HULEDET.com, users input their birthday information. The information is parsed to three columns (M, D, Y). In some cases, the data does not store correctly. There is no discernible pattern to when. Explain how you would go about solving this problem.

Locate the registration form on HULEDET.com and HULEDET.com/ShareTheLove. For each form, identify the location of the file that contains the code and validation information for the form. (Hint: It may not be a JS file)

Hard coded vs. User Input

The following script supports our user registration function. Unfortunately, the zip code field is currently storing in our database as 0, rather than the user input. (A) Identify and fix the error. (B) Change $user_registervia = 'website' to input the current URL instead of the website.

private $MasterID;

private $CertificateH;

public $email_address;

private $birthday, $birthmonth, $birthyear;

private $BirthdayDeployment, $belated = 'n';

public $Birthday;

public $IPAddress = '';

public $zipcode = 0, $state = '', $City = '', $country = 'USA';

private $source1 = 100001, $SourceName = 'HULEDET', $source = 'HULEDET.com';

public $Source;

public $registration = 900001, $registration_page = 'huledet.com';

private $fname = '', $lname = '';

public $name = '';

public $type = 'user';

public $gender = '';

private $password;

private $dbh;

private $Status_of_subscriber = 'subscribed';

public $status = '1';

public $foreign_zipcode = '';

public $user_registervia = 'website';

Missing Information in query

Our redemption system allows business clients to login, type in the certificate number theyre being presented with (CertificateH), and verify its validity. The system is to check that the same certificate has not been used within the last 60 days, and that it has not been used at the same location (Source1). However, an initial draft only checked against prior usage of the certificate number, not specific to the business.

Below youll see the query used. Please update the query to ensure that the user receives a That code has been used already message ONLY when its been used in the last 60 days at the same Source1 number.

$timeframe = date('Y-m-d H:i:s', strtotime('-60 days'));

$sql_query = "SELECT * FROM hul_redemption_history WHERE `CertificateH`='$certificate' AND RedeemedOn > '$timeframe'";

$res = mysql_query($sql_query, $sql);

if (!$res) {

$_SESSION['error'] = 'Sorry, our server seems to be down. We cannot validate at this time.';

header('Location:validate.php');

exit();

if (mysql_num_rows($res) > 0) {

$_SESSION['error'] = 'That code has been used already.';

header('Location: validate.php');

exit();

} else {

unset($_SESSION['error']);

$_SESSION['valid'] = true;

header('Location: redeem.php');

exit();

Importing data from a CSV file to a MySQL table:

We currently have a CSV file, named CSV1.csv with the following fields:

SourceNumber

Name

Address

City

State

Zip

A server based MySQL table named TableOne in a database named Database1 has the same fields, but is missing some of the information.

Write a script that imports data from the CSV file into the MySQL table where the SourceNumber is the unique id.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!