Advertisement

11.29.2007 at 05:59PM PST, ID: 22992267
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.6

PHP form cookie show only current record

Asked by lstraw in MySQL Server

Tags:

Hello.  This should be very simple for anyone who knows some about PHP, but Im struggling to figure it out.  I have a website, (fictional, for learning php), in which I have the user log in with their credentials, and this opens a page that they can edit fields, upload, etc.  It also gives them a cookie which is called on subsequent pages, which carries the username with it, which is the unique identifier.  My hope is to call from this cookie on a page so that once the user has logged in once, they can go to a different page and then click on the following page, called My_Files_Again.php, and it will bring up their profile.  Currently, it brings up every users profile, which is not what I need.  I've tried a number of SQL Query Statements, and the only one that seems to even allow me to see the page is a simple:  SELECT * FROM TABLE; .  
WHat i'm trying to do is say, if the cookie is recognized from the login page, then it will automatically display that user's form.  Don't know if i'm explaining this very well, but if it's unclear then just ask.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
<html>			
<?php  
$email = $_POST['email'];
$username = $_POST['username'];  
$plaintext = $_POST['password'];  
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$profileimage = $_POST['profileimage'];
$education_level = $_POST['education_level'];
$company = $_POST['company'];
$jobtitle = $_POST['jobtitle'];
$street = $_POST['street'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$birthday = $_POST['birthday'];
$website = $_POST['website'];
$phone = $_POST['phone'];
$aboutme = $_POST['aboutme'];
$resume = $_POST['resume'];
$ciphertext = md5($plaintext);  
mysql_select_db("cs17013");  
$qs = "select * from USER";  
$result = mysql_query($qs);  
$nrows = mysql_numrows($result);
$query = mysql_query($qs);
$con = mysql_connect("localhost","DATABASE","PASSWORD");
if (isset($_COOKIE["hiremecookie"]))
{
	print "<h3>Welcome, ".$_COOKIE['hiremecookie'].". Here is your information.</h3><ul>";
	mysql_select_db("DATABASE", $con);   
        $result = mysql_query("SELECT * FROM USER");
        while ($row = mysql_fetch_array($result))  
{
    		     
echo "<h3>" . $now . "</h3>";
echo '<img height="150" width="150" src="filepath' . $row['profileimage'].'">';
printf("<input type='hidden' name='MAX_FILE_SIZE' value='100000'>\n");
echo "<h2>" . "Upload a Profile Picture: " . "</h2>" . "\n";
printf("<input name='file' type='file'>\n");
printf("<input type='submit' value='Add Picture'>\n");
echo "<br>" . "\n";
echo "<br>" . "\n";
echo "<h2> " ,$row['fname'] ." " . $row['lname'] . "<br> " . "</h2> " . "\n";
print "<h2><b><a href = 'mailto:".$row['email']."'>".$row['email']."</a></b></h2>";
echo "<h3> " ."Other Information";  
echo "<h4> " ."Name: " .$row['fname'] ." " . $row['lname'] . "<br> " .  "Education Level: " .$row['education_level'] . "<br> " .  "Current Employer: " .$row['company'] . "<br> " .  "Job Title: " .$row['jobtitle']. "<br> " .  "Address: " .$row['street'] . "<br> " .  "City: " .$row['city'] . "<br> " .  "State: " .$row['state'] . "<br> " .  "Zip Code: " .$row['zip'] . "<br> " .  "Birthday: " .$row['birthday'] . "<br> " .  "Website: " .$row['website'] . "<br> " .  "Phone Number: " .$row['phone'] . "</h4> " . "\n";   
echo "<h3> " ."My Background " . "</h3> " . "\n";
echo "<h4> " .$row['aboutme'] . "</h4> " . "\n";
echo "<h3> " . "Skills" . "</h3>" . "<br> " . "<h4> " .$row['resume'] . "</h4>" . "\n";         
printf("</form>\n");   
	}
       } 
else 
{
	print "<b>Please Log In To Your Left or Register To View This Page.<br></b>";
}	
?>
 
</html>
 
 
[+][-]11.29.2007 at 06:07PM PST, ID: 20379282

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.29.2007 at 06:15PM PST, ID: 20379315

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.29.2007 at 06:21PM PST, ID: 20379338

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.29.2007 at 06:35PM PST, ID: 20379423

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.29.2007 at 06:57PM PST, ID: 20379550

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MySQL Server
Tags: php
Sign Up Now!
Solution Provided By: imitchie
Participating Experts: 1
Solution Grade: A
 
 
[+][-]11.30.2007 at 03:08AM PST, ID: 20380917

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628