Hello community,
I was really hoping to get some guidance on a little issue I'm having. I am in the process of building a site for my aunt, I'm mostly self taught and plugging away at building out my first multi page site.
Alas I have encountered a problem:
I need a splash page to popup when you click on the "store" link and have you either enter a zip or postal code. If a valid zip is entered you are ported to the US prices page, and if a valid Postal code is entered you are ported to the Canadian prices.

Any help or direction would be life saving thank you so much!

-Paul

Recommended Answers

All 2 Replies

For popup:

<a href="javascript:void(0)" onclick="window.open(''filename.html','popupWindow','height=500,width=600,left=30,top=40,toolbar=no,location=no,status=no,menubar=no,scrollbars=no');">Click</a>

and for popup window something like this:

<script type="text/javascript">
function checkCode(){
code=document.getElementById('code').value;
if(code!=""){
//here check the for the code and then add something like this:
window.opener.location.href="filename.html?page="+page
window.close();
}
}
</script>
Your postal code: <input type="text" name="code" id="code"><input type="button" value="Click" onclick="checkCode()">

And then you still have to add PHP code to you filename.html page (filename.php) for checking what page will be opened (change filename.html to filename.php). Something like this:

<?php
$page=$_GET['page'];
if($page!=""){
if($page=="page name") header("location:page url");
else header("location:other page...");
}
?>

Wow thanks so much for the help.
I think after I throw in some lines to make it pretty, and the company logo it should be looking sweet!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.