₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,067 members, 8,420,141 topics. Date: Thursday, 04 June 2026 at 12:05 PM

Toggle theme

Getting User Data Script...please Help Me Out - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingGetting User Data Script...please Help Me Out (1346 Views)

1 Reply (Go Down)

Getting User Data Script...please Help Me Out by cr80vity(op): 12:38pm On Feb 03, 2016
please can sumone help me out with the php script to get user data so dat wen d person logins in, it wil echo his/her username (e.g hello creativity)...but I want d script to use func_num_args together with func_get_args....I want it in a way dat d query select can b in array so I can choose to either echo $username or $firstname, etc...please help...I dnt mind if its done using function cux m told to write a function for it nd den call it but if dere s any oda way I stil appreciate...Tanks in anticipation
Re: Getting User Data Script...please Help Me Out by Nobody: 3:34pm On Feb 03, 2016
Very funny you want to echo two parameters as one? Why don't you just create a textbox and get the input directly then you do something like this


<?php
define("NAME","paul Hamilton"wink;
?>


Then in your program you can access it directly as

<?php
require_once('name.php');
echo "Hello",NAME;
?>


I'm coding from mobile, hope you get the idea.
Re: Getting User Data Script...please Help Me Out by cr80vity(op): 4:00pm On Feb 03, 2016
gimakon:
Very funny you want to echo two parameters as one? Why don't you just create a textbox and get the input directly then you do something like this


<?php
define("NAME","paul Hamilton"wink;
?>


Then in your program you can access it directly as

<?php
require_once('name.php');
echo "Hello",NAME;
?>


I'm coding from mobile, hope you get the idea.
m usin php procedural and mysql
Re: Getting User Data Script...please Help Me Out by A7(m): 5:07pm On Feb 03, 2016
Create two input fields with name='username' and name='firstname' and a submit button, use "get request".

Code to use:

If(isset($_GET['submit'], $_GET['username'], $_GET['firstname']) &&!empty($_GET['username']) &&!empty($_GET['firstname'])){

$print_out['username'] = $_GET['username'];

$print_out['firstname'] = $_GET['firstname'];

//this will return both username and firstname:

echo "<pre>", print_r($print_out),"</pre>";


//to echo just username or firstname, use:

echo $print_out['username'];

Or

echo $print_out['firstname'];
}


Nb:

You don't need arrays, you can individually echo each "get value" like:

echo $_GET['username'];

Or

echo $_GET['firstname'];


And what do you mean by query select? Is it mysql select query? If so use:

$sql = (put your select statement here);

$query = (execute the query here);

$row = mysqli_fetch_assoc($query);

echo $row['the value you want to echo out e.g username'];
Re: Getting User Data Script...please Help Me Out by Nobody: 6:57pm On Feb 03, 2016
cr80vity:
m usin php procedural and mysql
Meaning you want to fetch the user and echo his name directly from the base, thats what u mean ja?
Re: Getting User Data Script...please Help Me Out by cr80vity(op): 7:55pm On Feb 03, 2016
A7:
Create two input fields with name='username' and name='firstname' and a submit button, use "get request".

Code to use:

If(isset($_GET['submit'], $_GET['username'], $_GET['firstname']) &&!empty($_GET['username']) &&!empty($_GET['firstname'])){

$print_out['username'] = $_GET['username'];

$print_out['firstname'] = $_GET['firstname'];

//this will return both username and firstname:

echo "<pre>", print_r($print_out),"</pre>";


//to echo just username or firstname, use:

echo $print_out['username'];

Or

echo $print_out['firstname'];
}


Nb:

You don't need arrays, you can individually echo each "get value" like:

echo $_GET['username'];

Or

echo $_GET['firstname'];


And what do you mean by query select? Is it mysql select query? If so use:

$sql = (put your select statement here);

$query = (execute the query here);

$row = mysqli_fetch_assoc($query);

echo $row['the value you want to echo out e.g username'];
thanks alot...Pls wil d sql code echo d username of d user wenever he logs in like (hello Creativity) creativity bin d username
Re: Getting User Data Script...please Help Me Out by losprince(m): 9:07pm On Feb 03, 2016
you want to be a programmer but you don't want to write code
Re: Getting User Data Script...please Help Me Out by A7(m): 9:30pm On Feb 03, 2016
cr80vity:
thanks alot...Pls wil d sql code echo d username of d user wenever he logs in like (hello Creativity) creativity bin d username
If the user earlier signup on the system and you stored the signup details in mysql db and upon signing in you get the users details and query a match from the database and if a match is found, YES IT WILL.
Re: Getting User Data Script...please Help Me Out by cr80vity(op): 6:45am On Feb 04, 2016
losprince:
you want to be a programmer but you don't want to write code
boss v written d code bt I didnt get it dats y I came here.to ask
Re: Getting User Data Script...please Help Me Out by cr80vity(op): 6:46am On Feb 04, 2016
A7:
If the user earlier signup on the system and you stored the signup details in mysql db and upon signing in you get the users details and query a match from the database and if a match is found, YES IT WILL.
ok boss...
1 Reply

Do You Have Shipping Site Website Script? Please Contact Me234

Please I Need A Website That Do Tutorials On Java Pos Programming BluebambooHere Is How To Become A Web Designer Or A Web Developer Without Going To SchoolHow Do I Build An E-commerce Website Like Jumia, Konga