Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #14266 > unrolled thread

Is there anyone who could build this?

Started byandrewpaulford@gmail.com
First post2014-10-02 08:16 -0700
Last post2014-10-06 22:13 +0100
Articles 11 — 8 participants

Back to article view | Back to comp.lang.php


Contents

  Is there anyone who could build this? andrewpaulford@gmail.com - 2014-10-02 08:16 -0700
    Re: Is there anyone who could build this? "J.O. Aho" <user@example.net> - 2014-10-02 18:32 +0200
    Re: Is there anyone who could build this? Jerry Stuckle <jstucklex@attglobal.net> - 2014-10-02 12:35 -0400
      Re: Is there anyone who could build this? Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-02 16:49 +0000
        Re: Is there anyone who could build this? Jerry Stuckle <jstucklex@attglobal.net> - 2014-10-02 13:34 -0400
        Re: Is there anyone who could build this? "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-10-02 19:49 +0200
          Re: Is there anyone who could build this? Jerry Stuckle <jstucklex@attglobal.net> - 2014-10-02 15:56 -0400
    Re: Is there anyone who could build this? Doug Miller <doug_at_milmac_dot_com@example.com> - 2014-10-02 17:53 +0000
      Re: Is there anyone who could build this? Doug Miller <doug_at_milmac_dot_com@example.com> - 2014-10-02 18:00 +0000
        Re: Is there anyone who could build this? Matthew Carter <m@ahungry.com> - 2014-10-02 15:37 -0400
    Re: Is there anyone who could build this? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-06 22:13 +0100

#14266 — Is there anyone who could build this?

Fromandrewpaulford@gmail.com
Date2014-10-02 08:16 -0700
SubjectIs there anyone who could build this?
Message-ID<6dae4e9c-6aa9-4b98-b10a-d3648f42641c@googlegroups.com>
Is there anyone that can build this php because so far i havent been able to get anything to work its a social media network thats suppose to be built to these specs  https://docs.google.com/presentation/d/1_vjLMhxMPToGR8E937ZHIF7X9YmU680AK5IZcR4B9J0/edit#slide=id.p



so far i have written this but dont know where to go from here is there anyone that could build what i have around these requirements to help me please.



////my login page


<?php

include 'private/users.php';

$message = 'Please login:';

if($_SERVER['REQUEST_METHOD'] == 'POST')
{
	// Try to find a user with the posted username and password
	if($user = findUserByCredentials($_POST['username'], $_POST['password']))
	{
		// if a user is found we make a new UID for this session
		$user['uid'] = generateUID($_POST['username'], $_POST['password']);
		
		// update new login time
		$user['lastlogin'] = date('d-m-Y H:i:s');
		
		// save userdetails
		updateUser($user);
		
		// redirect to the memberpage and exit this script
		header('Location: members.php?uid=' . $user['uid']);
		exit;
	}
	
	$message = 'Wrong credentials!';
}
?>



<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Login</title>
    </head>
    
    <body>
        <p><strong><?php echo $message; ?></strong></p>
        <form method="post" action="">
        <input type="text" name="username" /><br>
        <input type="password" name="password" /><br>
        <input type="submit" value="Login" />
        </form>
    </body>
</html>





this would be greatly appreciated.

[toc] | [next] | [standalone]


#14267

From"J.O. Aho" <user@example.net>
Date2014-10-02 18:32 +0200
Message-ID<c95d0jFdehsU1@mid.individual.net>
In reply to#14266
On 02/10/14 17:16, andrewpaulford@gmail.com wrote:
> Is there anyone that can build this php

Yes, there are a lot of projects which has this feature.


> these specs  https://docs.google.com/presentation/d/1_vjLMhxMPToGR8E937ZHIF7X9YmU680AK5IZcR4B9J0/edit#slide=id.p

As your teacher to go trough secure coding, as the requirements used are 
kind of things warned for in OWASP.


-- 

  //Aho

[toc] | [prev] | [next] | [standalone]


#14268

FromJerry Stuckle <jstucklex@attglobal.net>
Date2014-10-02 12:35 -0400
Message-ID<m0jus3$2gh$1@dont-email.me>
In reply to#14266
On 10/2/2014 11:16 AM, andrewpaulford@gmail.com wrote:
> Is there anyone that can build this php because so far i havent been able to get anything to work its a social media network thats suppose to be built to these specs  https://docs.google.com/presentation/d/1_vjLMhxMPToGR8E937ZHIF7X9YmU680AK5IZcR4B9J0/edit#slide=id.p
> 
> 
> 
> so far i have written this but dont know where to go from here is there anyone that could build what i have around these requirements to help me please.
> 
> 
> 
> ////my login page
> 
> 
> <?php
> 
> include 'private/users.php';
> 
> $message = 'Please login:';
> 
> if($_SERVER['REQUEST_METHOD'] == 'POST')
> {
> 	// Try to find a user with the posted username and password
> 	if($user = findUserByCredentials($_POST['username'], $_POST['password']))
> 	{
> 		// if a user is found we make a new UID for this session
> 		$user['uid'] = generateUID($_POST['username'], $_POST['password']);
> 		
> 		// update new login time
> 		$user['lastlogin'] = date('d-m-Y H:i:s');
> 		
> 		// save userdetails
> 		updateUser($user);
> 		
> 		// redirect to the memberpage and exit this script
> 		header('Location: members.php?uid=' . $user['uid']);
> 		exit;
> 	}
> 	
> 	$message = 'Wrong credentials!';
> }
> ?>
> 
> 
> 
> <!doctype html>
> <html>
>     <head>
>         <meta charset="utf-8">
>         <title>Login</title>
>     </head>
>     
>     <body>
>         <p><strong><?php echo $message; ?></strong></p>
>         <form method="post" action="">
>         <input type="text" name="username" /><br>
>         <input type="password" name="password" /><br>
>         <input type="submit" value="Login" />
>         </form>
>     </body>
> </html>
> 
> 
> 
> 
> 
> this would be greatly appreciated.
> 

Need help with your homework?  Have you talked with your professor
and/or other students for hints?

I understand the professor is trying to limit what you have to use for
this project (i.e. no database), but you need to store this information
somewhere - which basically means a flat file.  So you will have to
define the format of that flat file, store the information in it, then
retrieve the information from it.

The easiest way would probably be to store a flat file with a name
related to the user's name.  Not very secure unless you can store it
outside of the website's document root.  If you can't, I would suggest
something like encrypting the filename based on the user's name.

Alternatively, you can store all of the users information in one file,
but then you have problems parsing the information.  Additionally, if
someone edits their profile, you will have to rewrite the entire file.
This could cause problems if two people try to update their profiles at
the same time.

Maybe this will give you a start.  Just a word of caution - this is not
how it's done in "real life" - people use both cookies and databases.
And having to parse the file makes it harder than it has to be.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#14269

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2014-10-02 16:49 +0000
Message-ID<m0jvml$2jd$3@dont-email.me>
In reply to#14268
On Thu, 02 Oct 2014 12:35:13 -0400, Jerry Stuckle wrote:

> The easiest way would probably be to store a flat file with a name
> related to the user's name.  Not very secure unless you can store it
> outside of the website's document root.  If you can't, I would suggest
> something like encrypting the filename based on the user's name.

Technically, whether you have one file per user or one file for all 
users, you still have a database, just not in a conventional format. I 
suspect that this may be one of the points the tutor intends to make from 
the exercise.

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [next] | [standalone]


#14270

FromJerry Stuckle <jstucklex@attglobal.net>
Date2014-10-02 13:34 -0400
Message-ID<m0k2b3$s45$1@dont-email.me>
In reply to#14269
On 10/2/2014 12:49 PM, Denis McMahon wrote:
> On Thu, 02 Oct 2014 12:35:13 -0400, Jerry Stuckle wrote:
> 
>> The easiest way would probably be to store a flat file with a name
>> related to the user's name.  Not very secure unless you can store it
>> outside of the website's document root.  If you can't, I would suggest
>> something like encrypting the filename based on the user's name.
> 
> Technically, whether you have one file per user or one file for all 
> users, you still have a database, just not in a conventional format. I 
> suspect that this may be one of the points the tutor intends to make from 
> the exercise.
> 

That's true, in the strictest sense.  However, you need to store the
data *somewhere*.  My thought was the professor was thinking of the
common meaning, that being SQL databases - although he could have been
more clear on that.

They probably haven't covered SQL yet, which would make the project that
much harder.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#14271

From"Christoph M. Becker" <cmbecker69@arcor.de>
Date2014-10-02 19:49 +0200
Message-ID<m0k36d$sgn$1@solani.org>
In reply to#14269
Denis McMahon wrote:

> On Thu, 02 Oct 2014 12:35:13 -0400, Jerry Stuckle wrote:
> 
>> The easiest way would probably be to store a flat file with a name
>> related to the user's name.  Not very secure unless you can store it
>> outside of the website's document root.  If you can't, I would suggest
>> something like encrypting the filename based on the user's name.
> 
> Technically, whether you have one file per user or one file for all 
> users, you still have a database, just not in a conventional format. I 
> suspect that this may be one of the points the tutor intends to make from 
> the exercise.

According to the 7th slide[1] no data should be stored at all, but
instead passed from form to form.  Apparently, "Phase 1" is meant as
exercise on form handling only.

[1]
<https://docs.google.com/presentation/d/1_vjLMhxMPToGR8E937ZHIF7X9YmU680AK5IZcR4B9J0/edit#slide=id.g3abd5cf68_099>


-- 
Christoph M. Becker

[toc] | [prev] | [next] | [standalone]


#14275

FromJerry Stuckle <jstucklex@attglobal.net>
Date2014-10-02 15:56 -0400
Message-ID<m0kako$q9b$1@dont-email.me>
In reply to#14271
On 10/2/2014 1:49 PM, Christoph M. Becker wrote:
> Denis McMahon wrote:
> 
>> On Thu, 02 Oct 2014 12:35:13 -0400, Jerry Stuckle wrote:
>>
>>> The easiest way would probably be to store a flat file with a name
>>> related to the user's name.  Not very secure unless you can store it
>>> outside of the website's document root.  If you can't, I would suggest
>>> something like encrypting the filename based on the user's name.
>>
>> Technically, whether you have one file per user or one file for all 
>> users, you still have a database, just not in a conventional format. I 
>> suspect that this may be one of the points the tutor intends to make from 
>> the exercise.
> 
> According to the 7th slide[1] no data should be stored at all, but
> instead passed from form to form.  Apparently, "Phase 1" is meant as
> exercise on form handling only.
> 
> [1]
> <https://docs.google.com/presentation/d/1_vjLMhxMPToGR8E937ZHIF7X9YmU680AK5IZcR4B9J0/edit#slide=id.g3abd5cf68_099>
> 
> 

Ah, you're right - I misread part of it.  I thought other user should be
able to log in with the userid/password again, and other users could
display the profile.  But I see I read too much into it - which means
you are correct.  Nothing need be saved.


-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#14272

FromDoug Miller <doug_at_milmac_dot_com@example.com>
Date2014-10-02 17:53 +0000
Message-ID<XnsA3BA8D361A8CAdougmilmaccom@78.46.70.116>
In reply to#14266
andrewpaulford@gmail.com wrote in
news:6dae4e9c-6aa9-4b98-b10a-d3648f42641c@googlegroups.com: 

> Is there anyone that can build this php because so far i havent
> been able to get anything to work its a social media network
> thats suppose to be built to these specs 
> https://docs.google.com/presentation/d/1_vjLMhxMPToGR8E937ZHIF7X9
> YmU680AK5IZcR4B9J0/edit#slide=id.p 
> 
> so far i have written this but dont know where to go from here

Perhaps if you paid more attention in class -- which is apparently CNT 4714 at the University 
of Central Florida -- you wouldn't have to go on Usenet to ask other people to do your 
homework for you.

Does Dr. Qu know that you're doing this?

> is there anyone that could build what i have around these
> requirements to help me please. 
[...]
> 
> this would be greatly appreciated.
>
Do I get the grade, too?

[toc] | [prev] | [next] | [standalone]


#14273

FromDoug Miller <doug_at_milmac_dot_com@example.com>
Date2014-10-02 18:00 +0000
Message-ID<XnsA3BA8E6F06423dougmilmaccom@78.46.70.116>
In reply to#14272
Doug Miller <doug_at_milmac_dot_com@example.com> wrote in 
news:XnsA3BA8D361A8CAdougmilmaccom@78.46.70.116:

> andrewpaulford@gmail.com wrote in
> news:6dae4e9c-6aa9-4b98-b10a-d3648f42641c@googlegroups.com: 
> 
>> Is there anyone that can build this php because so far i havent
>> been able to get anything to work its a social media network
>> thats suppose to be built to these specs 
>> https://docs.google.com/presentation/d/1_vjLMhxMPToGR8E937ZHIF7X9
>> YmU680AK5IZcR4B9J0/edit#slide=id.p 
>> 
>> so far i have written this but dont know where to go from here
> 
> Perhaps if you paid more attention in class -- which is apparently CNT 4714 at the 
University 
> of Central Florida -- you wouldn't have to go on Usenet to ask other people to do your 
> homework for you.
> 
> Does Dr. Qu know that you're doing this?

Just FYI... if he didn't before, he does now.
> 
>> is there anyone that could build what i have around these
>> requirements to help me please. 
> [...]
>> 
>> this would be greatly appreciated.
>>
> Do I get the grade, too?
> 

[toc] | [prev] | [next] | [standalone]


#14274

FromMatthew Carter <m@ahungry.com>
Date2014-10-02 15:37 -0400
Message-ID<874mvmmfeo.fsf@ahungry.com>
In reply to#14273
Doug Miller <doug_at_milmac_dot_com@example.com> writes:

> Doug Miller <doug_at_milmac_dot_com@example.com> wrote in 
> news:XnsA3BA8D361A8CAdougmilmaccom@78.46.70.116:
>
>> andrewpaulford@gmail.com wrote in
>> news:6dae4e9c-6aa9-4b98-b10a-d3648f42641c@googlegroups.com: 
>> 
>>> Is there anyone that can build this php because so far i havent
>>> been able to get anything to work its a social media network
>>> thats suppose to be built to these specs 
>>> https://docs.google.com/presentation/d/1_vjLMhxMPToGR8E937ZHIF7X9
>>> YmU680AK5IZcR4B9J0/edit#slide=id.p 
>>> 
>>> so far i have written this but dont know where to go from here
>> 
>> Perhaps if you paid more attention in class -- which is apparently CNT 4714 at the 
> University 
>> of Central Florida -- you wouldn't have to go on Usenet to ask other people to do your 
>> homework for you.
>> 
>> Does Dr. Qu know that you're doing this?
>
> Just FYI... if he didn't before, he does now.
>> 
>>> is there anyone that could build what i have around these
>>> requirements to help me please. 
>> [...]
>>> 
>>> this would be greatly appreciated.
>>>
>> Do I get the grade, too?
>> 

Delivering e-justice, one usenet posting at a time!

[toc] | [prev] | [next] | [standalone]


#14286

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2014-10-06 22:13 +0100
Message-ID<2296953.3YUb5Y6XnY@PointedEars.de>
In reply to#14266
andrewpaulford@gmail.com wrote:

> Is there anyone that can build this php because so far i havent been able
> to get anything to work its a social media network thats suppose to be
> built to these specs 
> 
https://docs.google.com/presentation/d/1_vjLMhxMPToGR8E937ZHIF7X9YmU680AK5IZcR4B9J0/edit#slide=id.p
> 
> 
> 
> so far i have written this but dont know where to go from here is there
> anyone that could build what i have around these requirements to help me
> please.

So far you are too lazy to benefit from or deserve any help.  That is also 
visible in *how* you post.

See <http://www.catb.org/~esr/faqs/smart-questions.html> for details.

-- 
PointedEars
Zend Certified PHP Engineer
Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web