473,507 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to only display a popup if the correct password is entered

1 New Member
Hi

I am looking to password protect the "Click to enlarge" link on a product info page.

Not sure if this is an html of javascript problem.

Currently the link is

CODE
Expand|Select|Wrap|Line Numbers
  1. <script language="javascript"><!--
  2. document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
  3. //--></script>
  4.  
I would like to put a password input field on the screen and if the password entered == the value in p.image_password, display the popup window showing the image in $product_info['products_image_permitted']

Get as far as

CODE
Expand|Select|Wrap|Line Numbers
  1. <form name="Form1" method="post" action="??????????????" onSubmit="return submitme()">
  2. Enter Password to see the image: <input type="password"  id="mypassword" /><br /><br />
  3. <input type="submit" name="Button1" value="Login" />
  4. </form>

and then lose it.

G
Feb 9 '09 #1
2 1300
rnd me
427 Recognized Expert Contributor
you would have to submit the password to a server script, verify it, and return a response that launches the window.

for extra security, you could not release the url of the popup until after the password is verified.

for example, the server script would return the url of the popup.

keep anything you want to protect from going out over the wire, because once it does, it's fair game to hackers.

you should ask on a php forum for suggestions on verification code.
Feb 9 '09 #2
c h e r r y
4 New Member
hi. have a form action for your verification. for example this is your query verification.php:

$password=$_POST['password'];

$query = "SELECT * FROM login_table WHERE password='$password'";

header(location:"your_pop_up_window.....");

then your form:

<form name="Form1" method="post" action="verification.php" ........

i hope it was helpful....
Feb 10 '09 #3

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

Similar topics

8
5451
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
1
1343
by: JL | last post by:
Hi all, I want to display a processing result after processed by popup windows, for example, i want to display the login name and login password in pop up window after user applied the new...
1
10045
by: bobano | last post by:
Hi everyone, I am writing a POP3 Client program in Perl. You connect to a POP3 Server and have a running conversation with the mail server using commands from the RFC 1939 Post Office Protocol....
10
2167
by: Sridhar | last post by:
HI, I am having problems setting up a website so that it will be available only inside the domain. We have three servers. One is iis server and second one is internal server and the third one is...
2
1721
by: dubdave | last post by:
Hi I wrote a very basic login script which acesses a mySQL database, like this:- <?php // compares values entered in login page form with mySQL database, and then directs either to...
1
2562
by: kang jia | last post by:
hi currently i am editing signup page, when user enter deupicated NRIC and click signup, they will go to do_signuppage and read the error message and then after 5 seconds, they will be redirected...
1
3209
by: kang jia | last post by:
hi when user entered particulars in signuppage and click" signup" button, i will direct them to do_signup.php. if say the NRIC is dupicate in datebase, i will redirect them back to signup page...
1
2088
by: Orit | last post by:
I have a question regarding usage of AJAX Control Toolkit's Popup Control Extender . I am using the Popup Control Extender to display a popup dialog ( panel ) from my asp.net page on click of a...
2
1700
by: Darvon | last post by:
Hello everyone. I have this website I would like to add some simple password protection to.. Nothing too fancy, so I decided to pull out an old javascript I came across sometime in the past that...
0
7223
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
7114
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
7488
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
5623
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
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.