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.

Help with displaying Values

Featured Replies

Can someone help me in making a PHP script so that when i login it displays

whatevers in another column...

in my DB i have 1 table and 4 columns

 

•Username = acct ID

•Ammnt. = info to be displayed

•Exp. Date = displayed below the ammnt. it is the date that the said ammount has to be paid

•location = location to be redirected to ( TAKE NO NOTICE OF THIS )

 

right now the script i have is when i login it redirects me to another another webpage that what that location column is for but instead i want it to display the ammount and the Exp. date any help would be appreciated. . .

 

 

 

 

 

This is the code for my login.html

 

<html>
<body>
<form method="post" action="checklogin.php">			
				 <fieldset>
					 <legend>Create User</legend>
					 <p><label for="Username">Acct. ID: </label><input type="text" name="username" id="username" /></p>


						 <input type="submit" name="submit" id="submit" value="Go" class="btn" />
	 </fieldset>
 </form>
</body>
</html>

 

 

 

 

The form action will look for checklogin.php

 

 

 

<?php
$host="localhost"; 
$username="root"; 
$password=""; 
$db_name="test"; 
$tbl_name="members"; 


mysql_connect("$host", "$username")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");


$username=$_POST['username'];


$username = stripslashes($username);
$username = mysql_real_escape_string($username);

$sql="SELECT location FROM $tbl_name WHERE username='$username' ";
$result=mysql_query($sql);


$count=mysql_num_rows($result);


if($count==1){

session_register("username");
session_register("id");
$get_url = "SELECT  location FROM $tbl_name WHERE username='$username' ";
$url=mysql_query($get_url);


$row = mysql_fetch_assoc($url);
$max_id=$row['location'];


		  header('Location: '.$max_id); exit;
}
else {
echo "Wrong Acct. ID!";

}
?>

Can someone help me in making a PHP script so that when i login it displays

whatevers in another column...

in my DB i have 1 table and 4 columns

 

•Username = acct ID

•Ammnt. = info to be displayed

•Exp. Date = displayed below the ammnt. it is the date that the said ammount has to be paid

•location = location to be redirected to ( TAKE NO NOTICE OF THIS )

 

right now the script i have is when i login it redirects me to another another webpage that what that location column is for but instead i want it to display the ammount and the Exp. date any help would be appreciated. . .

 

 

 

 

 

This is the code for my login.html

 

<html>
<body>
<form method="post" action="checklogin.php">			
				 <fieldset>
					 <legend>Create User</legend>
					 <p><label for="Username">Acct. ID: </label><input type="text" name="username" id="username" /></p>


						 <input type="submit" name="submit" id="submit" value="Go" class="btn" />
	 </fieldset>
 </form>
</body>
</html>

 

 

 

 

The form action will look for checklogin.php

 

 

 

<?php
$host="localhost"; 
$username="root"; 
$password=""; 
$db_name="test"; 
$tbl_name="members"; 


mysql_connect("$host", "$username")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");


$username=$_POST['username'];


$username = stripslashes($username);
$username = mysql_real_escape_string($username);

$sql="SELECT location FROM $tbl_name WHERE username='$username' ";
$result=mysql_query($sql);


$count=mysql_num_rows($result);


if($count==1){

session_register("username");
session_register("id");
$get_url = "SELECT  location FROM $tbl_name WHERE username='$username' ";
$url=mysql_query($get_url);


$row = mysql_fetch_assoc($url);
$max_id=$row['location'];


		  header('Location: '.$max_id); exit;
}
else {
echo "Wrong Acct. ID!";

}
?>

 

try this link it will help you

 

http://www.tizag.com/mysqlTutorial/mysqlfetcharray.php

  • Author

Tried it not so sure if thats what i want though

 

All i want is to display a single cell of data the ammnt. nevermind the exp. date

 

 

SO

 

•When you type in your acct. id and press go

•It takes you to a page or pops up a box displaying whatever is in the ammnt. cell

 

I dont want to display all of the ammnt. only the one corresponding to that acct ID

could anyone provide a script or teach me how to make one

 

you could add me in YM so that we could chat

philipcuddehay1(at)yahoo(dot)com

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.