473,411 Members | 2,164 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

how to display employer profile after they login?

127 100+
i did the register form and login page for employer(company), but i have no idea how to display the employer profile(employer information when they submit the register form which store in database)after the employer login. May i know the idea how to display company profile after they have login. Thanks..
Jan 26 '07 #1
2 5997
Motoma
3,237 Expert 2GB
i did the register form and login page for employer(company), but i have no idea how to display the employer profile(employer information when they submit the register form which store in database)after the employer login. May i know the idea how to display company profile after they have login. Thanks..
I'm assuming your form does either a POST or a GET operation to submit the form data. In your script, you can refer to the elements by the $_POST and $_GET variables.

If you have an HTML file that looks like:
[HTML]<form action="reg.php" method="POST">
<input type=text name=company />
<input type=submit name= submit value="Submit" />
</form>
[/HTML]

Then to reference the text field "company" your PHP code would look like:

[PHP]echo 'Thanks for submitting your company, '.$_POST['company'].'.';[/PHP]
Jan 26 '07 #2
bb nicole
127 100+
I'm assuming your form does either a POST or a GET operation to submit the form data. In your script, you can refer to the elements by the $_POST and $_GET variables.

If you have an HTML file that looks like:
[HTML]<form action="reg.php" method="POST">
<input type=text name=company />
<input type=submit name= submit value="Submit" />
</form>
[/HTML]

Then to reference the text field "company" your PHP code would look like:

[PHP]echo 'Thanks for submitting your company, '.$_POST['company'].'.';[/PHP]

Emm.. Thanks and sorry.. I don't really understand... I show my coding here, then maybe you will know more detail what i'm doing. Below is my php code forregister form and login function for company..The information that company register will save in (database)mysql. Now i need to do a function which is when the user(company)login on my website, they can view and edit their company profile.
Note: company profile is the register information they had submitt when they register..Thanks..


REGISTER FORM

[PHP]<?php
include_once("database.php");


class user {


function linkid ()
{
$db = new db();
$link_id = $db->dbconnect();

return $link_id;
} // end function linkid

function add_user($arr)
{




$link_id = $this->linkid();

$companyName = $arr['companyName'];
$companyType = $arr['companyType'];
$contactName = $arr['contactName'];
$description = $arr['description'];
$username = $arr['username'];
$password = $arr['password1'];
$password2 = $arr['password2'];
$emailAdd = $arr['emailAdd'];
$contactNum = $arr['contactNum'];
$fax = $arr['fax'];
$contactAdd = $arr['contactAdd'];
$city = $arr['city'];
$postcode = $arr['postcode'];
$state = $arr['state'];
$country = $arr['country'];



if($companyName==""){
$message="Opps.. You forgot enter your Company Name!<br>";
include("emp_register.php");
}


else


if($username==""){
$message="Please select a username!<br>";
include("emp_register.php");
}


else


if($password==""){
$message="Please select a password!<br>";
include("emp_register.php");
}


else


if($password2==""){
$message="Please re-type password!<br>";
include("emp_register.php");
}


else


if($password!=$password2){
$message="Password and re-type Password not same!<br>";
include("emp_register.php");
}


else


if($emailAdd==""){
$message="Opps.. You forgot enter your Email Address!<br>";
include("emp_register.php");
}


else


{


$myquery = "INSERT INTO company ( companyName, companyType, contactName, description, username, password, emailAdd, contactNum, fax, contactAdd, city, postcode, state, country )
VALUES ( '$companyName', '$companyType', '$contactName', '$description', '$username', '$password', '$emailAdd', '$contactNum', '$fax', '$contactAdd', '$city', '$postcode', '$state', '$country' )";

$result = mysql_query($myquery,$link_id) or die(mysql_error());

include_once("emp_registered.php");


}
}
}


?>[/PHP]

LOGIN FUNCTION

[PHP]<?php

extract ($_POST);

mysql_connect("localhost","root","")
or die("Cannot connect to the server");

mysql_select_db("ums e-job portal")
or die("Cannot connect to the database");

$sql="select username from company where username='$username'";

$result=mysql_query($sql)
or die("Cannot execute query");

$num=mysql_num_rows($result);


if($num==1) //username valid
{
$sql="select username from company where username='$username' and password='$password'";

$result2=mysql_query($sql)
or die("Cannot execute query");

$num2=mysql_num_rows($result2);
if($num2>0)
{
setcookie("Username", $username, time() + 60 * 60 * 24 * 365);
$today= date("D F d, h:ia");

include("welcome.php");

}
else //message send to emp_login.php when wrong password
{
$message="The username, $username exists, but you have not entered the correct password! Please try again.<br>";
include("emp_login.php");
}
}
elseif($num==0) //message send to emp_login.php when username not valid
{
$message="The username you entered does not exist! Please try again.<br>";
include("emp_login.php");
}



?>[/PHP]
Jan 26 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Robert Tarantino | last post by:
Hello, I am trying to find a way to create a scheduled task or service that will copy my local profile folders under "Documents and settings" to a network drive. This would allow me to restore...
0
by: Lloyd Dupont | last post by:
I want to write my own login control. I want it to be friendly with the (new) Login & profile stuff. (I do my own as I want to let the user either its email or login in the same box, and I want to...
6
by: Shimon Sim | last post by:
Hi I am working on application that need to hold custom user information - Last and first name, email, some other domain related information. I used to create Base class for all my pages. The base...
8
by: VB Programmer | last post by:
I would appreciate your assistance on this ASP.NET 2.0 site.... This is the wierd problem: While accessing the built in .NET functions for 'profiling' or 'membership' an error is generated (see...
1
by: Giovanni | last post by:
Dear Friends, I am having problems with the following: I have added a Login control to a web page. In the Login control's Authenticate event, I am performing additional validation against our...
2
by: Annie | last post by:
Hello guys, I have set the MEMBERSHIP, ROLEMANAGER and PROFILE in my config file as below. I just want to use my own sql server 2000 table instead of MSDB.
0
by: =?Utf-8?B?Um9iZXJ0byBSYXp6YXV0aQ==?= | last post by:
I've a problem to change a profile property during button click event in a login.aspx page. I try to set profile.property = xxx but after authentication this property remain to defaultvalue by...
1
by: Rusty Hill | last post by:
My site does not allow anonymous users. After a user has logged in and been authenticated I need to access some information in their profile object. I thought I would do this in the LoggedIn...
5
by: Steven | last post by:
I have the following in my web.config: <system.web> <profile defaultProvider="MyASPSqlProfileProvider" enabled="true" > <properties> <add name="FirstName" defaultValue="" type="string"/> <add...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.