View Full Version : Send data to a new page from submit

07-21-2007, 02:10 PM
Hi there

I just posted a question to the Javascript area, but was advised to check this forum for PHP... I have no clue where to start as I do not know any PHP (I have seen it, but have never programmed with it).

Basically what I want to do is have 3 select lists, where the user selects their birthdate (one select list for day, one for month and one for year), then they click on the submit button, which needs to take them to the relevant page for their star sign. Below is the javascript post I made that has the javascript code to make a javascript pop-up telling the user whattheir star sign is...


I am sure there must be some code for this somewhere, surely? I have been searching google for some code, but havent as yet found what I want...

Any possibility of help on this one??

Natasha :)

07-21-2007, 02:52 PM
if using POST for the method use
$dob = $_POST['day'] './.'$_POST['month']'./.'$_POST['year'];
//this will be 09/05/1987
$star = $_POST['day']'./.'$_POST['month'];
//this is now shortened to 09/05
//use arrays() to keep in which starsign they are
$capricorn = range(01/02, 01/03);
//now use a switch to see which starsign they are in,

obviously this is not full and or correct code, its provided as an example

07-21-2007, 03:09 PM
Thanks for that, I think I understand what you're saying... looks pretty logical... obviously there is more to it....

Now my next question is - where can I find step-by-step, really basic and simple instructions on how to install and IIS server on my computer, so that I can play with the PHP scripts and see what they output? At present, I can only upload the pages to my web host, which is fine, as I can make delete it after testings, but its a rather laborious way of doing things...

Appreciate any pointers on this?


07-21-2007, 03:15 PM
You might want to check out WAMP (http://www.wampserver.com/en/), which is an easy way to install Apache (server), PHP, and MySQL.


07-21-2007, 03:32 PM
or XAMPP (http://www.apachefriends.org/download.php?xampp-win32-1.6.2-installer.exe)

07-21-2007, 04:49 PM
Thats what I wanted!

I was looking into installing Apache server (with PHP playability) before, but I was trying to do it from Apache and it just went straight over my head.... those two links to these applications are just what I need!!

Thanks a lot :)

07-22-2007, 03:19 AM
Okay I have downloaded both of these applications... read about what the difference between them is and looked at who prefers one over the other and I cannot decide which one to use, everyone seems to have their own opinion about which one is easier...:confused:

Which one would be better for the complete and utter novice to test servers and PHP etc?? Like seriously no clue user.... I am quick to learn, but right now, no clue... ;)

07-22-2007, 05:27 AM
The biggest difference for you between the two is that XAMPP installs Perl along with PHP. If you aren't interested with Perl, you could just use WAMP, but if you think you might use that in the future, you might as well go the extra mile and grab XAMPP.

(I'm assuming that you're using windows, since you referred to IIS)


07-22-2007, 05:43 AM
I am quick to learn, but right now, no clue... ;)

Few things you need to learn about are

What is web server (http://en.wikipedia.org/wiki/Web_server)

Then what is server side scripting (http://en.wikipedia.org/wiki/Server-side_scripting)

And then PHP (http://en.wikipedia.org/wiki/Php)

It may look like a lot's of reading, but it's sure gonna set you off to a good road of web programming. If you programmed before, it's not gonna be a problem, if you didn't, than it might sound to weird. Programming is weird, and you might turn into geek, but that's just professional deformation.. :lol: :D

07-25-2007, 02:49 PM
Thanks for the responses - I think I will go with WAMP as I probably wont be using Perl ;) And yeah I am using Windows OS.... and I will check out those links too :)

Programming, yeah I try to avoid it as much as I can, but I just keep on going down that road ;) lol

07-25-2007, 03:07 PM
web link (http://tizag.com/phpT/)

PHP Programming for Beginners

very good website

ATB :thumbsup:



07-28-2007, 02:35 AM
Thanks for the link - I have been on that site....

Okay, I downloaded WAMP and I am a bit lost!!

Umm, I am having some difficulty in understanding how to view my files - I am not understanding the directory structure of the local host... I have a few different web sites I need to test and view the php files, and I got one of them to work, did the same thing for the other one and it didnt give me a preview ?? I am doing something wrong, but I dont know what... normally I can work things out, but this has me stumped...

I have never working with a local testing server and am really keen to do so, but I dont know what to do.... I am using windows and have IIS installed...

Is there any site / info anyone can point me to, to help me understand what I am doing?


07-28-2007, 02:44 AM
Make sure WAMP is running - it might be blocked on startup by an antivirus program.

Make sure your files are in the correct directory:
(I think the defalt is C:\wamp\www)

Place a folder containing your entire website inside the folder above, or wherever your server root is, if you didn't use the default.

Then try to access it via a browser by pointing the browser at localhost/"name of the subfolder containing your entire website"

You can put as many sites in the root directory as you want, but put each site in its own folder, like this:


localhost/site1 is the URL for the first site, localhost/site2 is the URL for the third site, etc.


07-28-2007, 03:23 AM
Dan - thanks

Thats exactly what I did (other than putting the localhost/site1 as the URL)... I figured out that I had to add the site files in the wamp/www folder (when I saw that the php file that did preview properly in browser got copied there)....

I am running Dreamweaver, and I specified the following in the testing server tab of the site management tool:

Server Model - PHP/MySQL
Access - Local/Network
Testing Server Folder - C:\wamp\www\mysite
URL Prefix - http://localhost/

Is there something I am missing???

07-28-2007, 03:28 AM
I have tried it with:
URL Prefix - http://localhost/mysite

and it didnt work either - kept giving me the following error message:

The site URL prefix for the testing server does not match the site URL prefix specified in the HTTP address for the site. This may cause pages using site relative links to display incorrectly at runtime. Proceed anyway?

07-28-2007, 04:31 AM
What gave you the error?

The browser or Dreamweaver?

What happens if you proceed anyway?

Where is the HTTP address specified for the site? try changing that to localhost


07-28-2007, 05:10 AM
The below error came from Dreamweaver when I was trying to set up the site info, for the testing server....

When I just have http://locahost - then I get the standard "This page cannot be found" in the browser if I try to preview any page (not just a php page).

I have saved my files to a folder - wamp/www/site1, but this doesnt seem to work... it wants me to have all the files in the root directory (www) without adding folders, but I cant do that as I have a few sites and need to separate them...

Feeling very frustrated as I am sure the solution is really simple, but I am not getting it...

I have tried it with:
URL Prefix - http://localhost/mysite

and it didnt work either - kept giving me the following error message:

The site URL prefix for the testing server does not match the site URL prefix specified in the HTTP address for the site. This may cause pages using site relative links to display incorrectly at runtime. Proceed anyway?

07-28-2007, 05:23 AM
If you have wamp installed, just test it with your browser by url http://localhost. make sure wamp is running.

Dreamweaver is program, and has it's own demands, if you don't know how to set it up right, or if your sites were loaded from other folders than ones your localhost is, it's going to show some notices. Don't wory. Just browse to your localhost, and link to the folder where your new site is, and test it. DW is for newbies :D

07-28-2007, 05:39 AM
Yeah I tried http://localhost and it is working.... the window that opens up to tell me its working, also says: To add documents to your default Web site, save files in c:\inetpub\wwwroot\.

For some reason, my WAMP is only running one service - mySQL, its not running Apache and when I try to start/resume the service, it does nothing...

I use Dreamweaver (and have been for ages, because, for me, a non-programmer, its great)...

I am a newbie to PHP and dynamic page programming and local/testing servers ;)

07-28-2007, 05:49 AM
For some reason, my WAMP is only running one service - mySQL, its not running Apache and when I try to start/resume the service, it does nothing...


well, if apache isn't running, you should restart your computer and try again. something is REALLY wrong if it's not running ;)

07-28-2007, 06:24 AM
Yeah thats what I thought - I just tried to see what is going on with all the services I have...

I have restarted my computer, but still the same thing...

When I test Port 80 - it tells me that its actually being used by Microsoft-IIS/5.1

It sounds like I have the Windows IIS local server already? And installing XAMP is somehow in conflict with it?

Any idea what I can do? Remember, I know nothing about this stuff, so if you tell me anything, baby steps please :)

Thanks for everything so far, I totally appreciate it :)

07-28-2007, 06:33 AM
I think part of it may have something to do with the directory structure...

When I read the instructions, I created a file myTestFile.html and stored it here- C:/wamp/www/myTestFile.html, and when I view it in my browser, it shows fine...

The problem is the PHP files, which I am guessing has to do with the conflict with IIS and WAMP? I dont understand...

07-28-2007, 06:54 AM
Your problem is IIS. It's running on the same port as Apache.
You should either

*change the port of Apache in httpd.conf file. (find Listen Port, and change it to, something like 8080

*disable IIS service..

07-29-2007, 10:22 AM
Thanks matak...

That sounds about right.... but you know what? I dont even know how to change the port of Apache - cant even open the httpd.conf file as I dont know what application opens it (probably DOS?) and I dont even know what "listen Port" even means... lol.... told ya, I am a totally newbie ;)

07-29-2007, 01:18 PM
He is suggesting that you edit the httpd.conf file...it opens with notepad. If not, you can open it with notepad. I installed Apache myself and I can go to Start > All Programs > Apache Server > Configure Apache Server > Edit httpd.conf

I'm not sure if thats applicable when installing via WAMP/XAMPP but you should be able to navigate to the Apache folder (whereever you have it installed) going into the 'conf' folder and open the httpd.conf file. (There is another file called httpd.default.conf which you can use as a back up if you mess up your current configuration file.)

Once you have the file open, you can use FIND (ctrl +f) and type in Listen and changing the value of the listening port to any free port like 8080.

07-29-2007, 04:46 PM
Ahhhh!!!!! I found the file before, but I didnt try to open it.....

Thank you - that was all I needed.... to get Apache changed to another port and now it is running!! Yippeee....

And after a few trials and errors, I worked out how to make the PHP files preview in my browser!!!!!!!!!!! Yeahhhhhhhhh.....

URL Prefix = http://site1
(I didnt need local host in there as I already had it in the file location specification of files in the testing folder)

Damn, thats all it was!!!

Thanks to everyone who helped me - I can now preview my PHP files!!

I'll always be a newbie, but at least now I can check php files in my browser and see if I can modify them ;)


07-29-2007, 06:13 PM
Glad you solved your problem. :)

Having that ability to test your files locally is a good way to stop beeing a newbie. j/k

If you want to go crazy set error reporting E ALL on top of the files you are testing.

<?php error_reporting(E_ALL); ?>

So php will show you all errors (you can modifiy that in php.ini, also opened in notepad)

07-30-2007, 01:05 PM
Cool - thanks for the tip :)