473,395 Members | 1,790 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,395 software developers and data experts.

Photo Gallery Website

rcollins
234 100+
I have a daughter and son in law in iraq. I am taking care of the grandbaby till they get back. There are so many family members and them over seas that I fealt a web site where they all can access them would be a very good idea. I have a domain name already, made my front page. On the main page there is a link to nothing, because this is where I want to control access with passwords. I right most of my code in straight html using css. I have no clue how to do the secure part. Can someone point me in the right direction?
Jun 3 '08 #1
15 1958
eWish
971 Expert 512MB
This must be done with a server side language or by using your web server. If you would like I can move this post to the fourm of your choice. Sorry, but this is not an HTML/CSS issue.

--Kevin
Jun 3 '08 #2
rcollins
234 100+
I wasn't sure where to put this one, you can move me...I need help
Jun 3 '08 #3
eWish
971 Expert 512MB
How do you wish to achieve this? Do you know any server side languages, ie: PHP, Perl, ASP, Ruby? Please advise me of where you would like this post moved to and I will be glad to do that for you. There many pre-made script available online for free. Search for Free Login Scripts.

--Kevin
Jun 3 '08 #4
rcollins
234 100+
I know some php, that is what we learned in my 3rd website class in college,,and I have books, too
Jun 3 '08 #5
Markus
6,050 Expert 4TB
I know some php, that is what we learned in my 3rd website class in college,,and I have books, too
Read up on php then - check out some phptutorials().

It's definitely - in my oppinion ;) - the best way to go.

Shouldn't take you long to brush up on the basics.

And by the sounds of it, all you'll need is the basics.

Once you've learnt the basics, you won't want to stop!

Deadly cycle, trust me!
Jun 3 '08 #6
hsriat
1,654 Expert 1GB
I have a daughter and son in law in iraq. I am taking care of the grandbaby till they get back. There are so many family members and them over seas that I fealt a web site where they all can access them would be a very good idea. I have a domain name already, made my front page. On the main page there is a link to nothing, because this is where I want to control access with passwords. I right most of my code in straight html using css. I have no clue how to do the secure part. Can someone point me in the right direction?
If this is your only need from PHP, then its not a big task.

I see your need is just to show your pictures to few of your family members. I'll just give a short script and you can use that.


index.php (add this somewhere in your main page and name your page as index.php)[html]<form action="pictures.php" method="post">
Id:<input name="id" type="text" /><br />
Password:<input name="password" type="password" /><br />
<input name="login" type="submit" value="Submit" />
</form>[/html]


pictures.php[php]<?php

require ("ids.php");

if (isset($_COOKIE["viewer_id"]) && isset($_COOKIE["viewer_password"]))
if ($_COOKIE["viewer_password"] == md5($passwords[array_search($_COOKIE["viewer_id"], $ids)]))
{
show_list_page();
exit();
}

if (isset($_POST["login"]) && isset($_POST["id"]) && isset($_POST["password"]))
if (in_array($_POST["id"], $ids))
if ($_POST["password"]==$passwords[array_search($_POST["id"], $ids)])
{

$hour = time() + 86400; //FOR 24 HOURS
setcookie("viewer_id", $_POST["id"], $hour);
setcookie("viewer_password", md5($_POST["password"]), $hour);

show_list_page();
exit();
}

header ("location:index.php");

function show_list_page()
{

?>

<!-- copy here the HTML that contains the list and links to all the pictures -->

<?php
}[/php]

logout.php (Link this somewhere in pictures.php)[php]<?php
$past = time() - 100;
setcookie("viewer_id", "", $past);
setcookie("viewer_password", "", $past);
header("location:index.php");
?>[/php]

ids.php[php]<?php
$ids = array(
"my_id",
"your_id",
"his_id",
"her_id"
);
$passwords = array(
"my_password",
"your_password",
"his_password",
"her_password"
);
?>[/php]This ids.php contains the list of all the ids and passwords which you can give your relatives. You can add ids and passwords in it, but you would need to be careful that the serial order remains respective.

The only limitations are, user can't himself change the password and you may not have TOO many ids and passwords.

I have not tested it, so if any problem is there, do let me know.

Regards,
Harpreet
Jun 3 '08 #7
rcollins
234 100+
so, instead of trying to put this in my code, I figured I can add my code to this. The problem I am having, and this is just copying and pasting the info into the three new files, is that when I try to open .php files it prompts me to open or save. This is a continuous circle. Can you test it and see what is wrong? Thanks
Aug 10 '08 #8
miraan
24
This is because you are trying to access the files from your local computer. First you need to upload these three files to your domain which you said you had, make sure that the webserver that your domain is on supports php though otherwise it will not work. Most webservers have php installed so that is not really an issue. To upload some files just find your FTP details given to you by your webhosting company in a welcome email or in your control panel and use them with an FTP client such as SmartFTP or BitKinex or Ipswitch WS_FTP. Then just copy and paste those three files into the directory on your domain where the public can view those files. This folder on your domain is usually called public_html or www. When you have uploaded them, go to your website and you should be on index.php and the log in form displaying.

Remember, PHP is server-side code, it is interpreted by a server that has php installed. HTML and CSS are interpreted by the web browser.

Hope this helps,

Miraan
Aug 10 '08 #9
Markus
6,050 Expert 4TB
To develop on your local PC / whatever OS, you need to have a server installed.

Google XAMPP
Aug 10 '08 #10
rcollins
234 100+
so if I upload this to the server where I host my website, it will work?
Aug 11 '08 #11
hsriat
1,654 Expert 1GB
so if I upload this to the server where I host my website, it will work?
Of course... just upload the files, and see if it works or not, and let us know in case it doesn't (along with the error).
Aug 11 '08 #12
rcollins
234 100+
OK So far so good, the .php pages are working. The problem is that if I log in with out a username or password, it still loads the page. did I miss something? I can give you my website address if you would like to see
Sep 3 '08 #13
I tried the sample code and it works fine!

If you try to load pictures.php and are not logged in yet, it redirects you to the login page (index.php) in this case.

When you successfully log in, you are redirected to pictures.php which will show your page. Adding a logout link to logout.php will clear the cookie settings when the users links to it. The next time the user tries to load pictures.php, he/she will be redirected to the index.php to enter the user/password.

regards,
phpNerd01
Sep 7 '08 #14
hsriat
1,654 Expert 1GB
I tried the sample code and it works fine!

If you try to load pictures.php and are not logged in yet, it redirects you to the login page (index.php) in this case.

When you successfully log in, you are redirected to pictures.php which will show your page. Adding a logout link to logout.php will clear the cookie settings when the users links to it. The next time the user tries to load pictures.php, he/she will be redirected to the index.php to enter the user/password.

regards,
phpNerd01
That is exactly what I expected from the code.
Sep 21 '08 #15
NeoPa
32,556 Expert Mod 16PB
A hijack post was posted in here and it has now been split into its own separate thread (Developing Photo Gallery).

Anyone interested in helping this (new) user is welcome to link across ;)
Sep 26 '08 #16

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

Similar topics

10
by: matt | last post by:
I have this code, works perfectly on Windows server, but now i'm trying to run it on a Linux server, the form submits, i get no errors, but the photo doesnt upload, and the caption file doesnt...
5
by: fraser | last post by:
Hi, I have a photo gallery with cat photos here http://mouserspage.cjb.net From the beginning, I have been making each page of thumbnails, with a separate page for each photo, entirely in...
3
by: bob garbados | last post by:
I'm looking for thoughts on photo galleries and security/performance implications... I'm working on an asp.net site in vb that will include an updateable photo gallery that will display thumbnails...
7
by: Eric Lindsay | last post by:
I would like to do a photo gallery with a liquid layout. I wanted to center a caption below each photo (or above each photo). I can do that easily with tables, but then I don't have a liquid...
1
by: desjardins.daniel | last post by:
Hi ! Excuse my english, i'm a french canadien... So here my message : I have put on my site a photo gallery and at the right a nav menu. This menu has a red dot visible want someone is passing...
13
by: Viken Karaguesian | last post by:
Hello everyone, Can anyone recommend a good online site to learn PHP? The W3Schools website is quite lacking - leaves much to be desired. I'm sure there are many places, but which ones are good?...
1
by: Throw | last post by:
G'day everyone I'm looking for a simple photo gallery script in PHP (or Perl), but not too simple. I have tried several photo gallery scripts in either language and I have found that they are...
1
by: Xah Lee | last post by:
The following is a program to generate thumbnail images for a website. Useful, if you want to do that. It is used to generate the thumbnails for my “Banners, Damsels, and Mores” project...
1
by: popotz | last post by:
Hi..I really need a big help.. I was wondering how to make my own photo gallery for my own website. The photo must be uploaded first, and then it automaticly putted into the gallery..if we click...
0
nomad
by: nomad | last post by:
Hello Everyone. I founded an Flash and xml photo gallery. It works but I took it to another step What I want is to have six different galleries in one Flash file. I figure out how to do that but ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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 projectplanning, coding, testing,...

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.