VeggieBoards banner
1 - 20 of 38 Posts

·
Banned
Joined
·
10,763 Posts
Discussion Starter · #1 ·
So I don't have to upload the file again, by ftp, to my server, every time I make a minor change in a program I am working on. Same goes for mySQL. I understand I need to have apache server on my computer, first. Problem is, there are so many alternate files of each program, that I don't know what to download. I have Windows XP Pro.

Help!

What on earth is an "*.msi" file?
 

·
Banned
Joined
·
10,763 Posts
Discussion Starter · #3 ·
Because installing a dual boot system is lots more work. Learning how to use partition magic seems like quite a chore, all by itself. I already installed the apache server for win32 -- is that the right one? But I'm not sure if it is working. I have a changing ip number, so I can't really set up a web server.

The php instal instructions say make sure your apache server is working. But I can't figure out how to do that. http://httpd.apache.org/docs/2.0/en/invoking.html makes no sense to me whatsoever. apache ased for web serer info when it installed, but it the default stuff it plugged in looked like the web site for my dsl modem - so i just blanked out those text boxes before continuing the installation.

I've downloaded php 4.4 zip, but not installed it yet because I don't know how to chec, if apache is working. I can't boot unix from a cd because my cd rw drive isn't working in write mode. In fact, not only does it never write correctly, but it seems to have a lot of trouble reading home-made data cd's It only reads factory-produced data cds, and music cd's.
 

·
Ex-*****
Joined
·
5,391 Posts
Quote:
Originally Posted by soilman View Post

The php instal instructions say make sure your apache server is working. But I can't figure out how to do that.
Did you try going to http://localhost/ ? If Apache is installed, you should see something on that URL.
 

·
Banned
Joined
·
10,763 Posts
Discussion Starter · #5 ·
Quote:
Originally Posted by Indian Summer View Post

Did you try going to http://localhost/ ? If Apache is installed, you should see something on that URL.
Yup. In opera, I got something in spanish. In msie, in english. If i move an html file to the directory that apache is in (c:\\program files\\apache-something\\conf or something) and do http://localhost/filename.html, I see the file with the http connection. However if it is a php file, php isn't working, even tho I've installed php, and copied php's dll file and php.ini to the windows/system (and system32) folder.
 

·
Banned
Joined
·
10,763 Posts
Discussion Starter · #6 ·
OK. I had to fiddle with the httpd.conf file for about 3 hours, and move files from the php installation all over the place (into c:\\windows\\system, etc) and not I got SOME parts of a php program to work. For example a loop is executing, and the counter variable is printing out, that is, with the loop below (starting at while)

Code:

$npitch=1;

while ($npitch <=88) {

print ("$npitch is $pitch[$npitch]
");

$pitch[$npitch]=pow(2,($npitch-49)/12 )*$A49;

$npitch=$npitch+1;

}

$pitch is being incremented and printed out but pow(2,($npitch-49)/12 )*$A49 is not being calculated. And $pitch[$npitch] is instead repeatedly displaying as zero.

This program DOES work from my web hosting company. Just not from my home installation.

Here is how it is supposed to look. http://shakahara.com/pitch.php Enter any number around 440 in the top box, and any number from 1 to 88 in the bottom box. Then press the submit button. You'll see a bunch of calculations. On my home set up, the inititial screen comes up the same, but the calculations don't work. I'm getting all zeros in the right-hand columns.
 

·
Registered
Joined
·
1,182 Posts
This probably would've helped you.

With your problem, why don't you check the server error log. Maybe there's a syntax error or undefined variable.

~Wonder
 

·
Banned
Joined
·
10,763 Posts
Discussion Starter · #8 ·
No error. I must need a module. I have the EXACT same program at http://shakahara.com/pitch.php and it is working THERE. Try it. Make the entries. It WILL add subtract multiply and divide. I must need some extra module for it to do pow($variablename) because it isn't doing that.

By the way, this calculates the frequencies of all 88 notes on a 88-note keyboard (for example a piano) in an equally tempered octave (12 tones octave), given a reference pitch for concert A (key 49 on the piano) of 440, or any other pitch you want to start from (like 433 or 446 or whatever). Later I'm going to calculate all the intervals and the difference of the tempered interval from a just interval.
 

·
Banned
Joined
·
10,763 Posts
Discussion Starter · #9 ·
OK. I think I erred. I think the problem is it isn't reading the input that gets put in the text box. Not sure why. It's getting the input, as I can see by changing the method from post to get -- the input gets properly placed on the browser address bar.

Yup. That's it. The entries in the html form aren't being read, or at least, not being passed to php. Can't figure out why.
 

·
Registered
Joined
·
1,182 Posts
Post your code, or PM it to me. I'll see what's wrong with it. You should get the input through the $_POST array.

~Wonder
 

·
Banned
Joined
·
10,763 Posts
Discussion Starter · #11 ·
wonder, I already indicated the code above. Like I already said twice, this is an exact copy of the file that isn't working on my home server, but is working on my hosting co's server.

there is nothing wrong w the code. php on my computer isn't picking up variables from html names in html forms. It must be the php and not the apache server, because javascript IS picking up the input variables.
 

·
Banned
Joined
·
10,763 Posts
Discussion Starter · #12 ·
here is the whole thing

Code:

Untitled Document

<?php

$npitch=1;

print ("A49 has been given the value of $A49

");

//print "note# Â* Â* Â* pitch";

print "

";

/*Create an array $pitch[$npitch]*/

while ($npitch <=88) {

//print ("$npitch Â* Â* Â*");

//print (pow(2,($npitch-49)/12)*$A49);

//print "
";

$pitch[$npitch]=pow(2, ($npitch-49)/12 )*$A49;

print ("$npitch is $pitch[$npitch]
");

$npitch=$npitch+1;

}

print "
";

print $pitch[48];

print "
";

print "end first list

";

/*Print each element, $pitch[$pnum] of the array created above.*/

$pnum=1;

while ($pnum>=1 && $pnum<=88) {

print ("key $pnum is $pitch[$pnum]
");

$pnum=$pnum+1;

}

print "
end second list

";

/*Print one element of the array.*/

print ("key $which is $pitch[$which]
");

?>
 

·
Registered
Joined
·
1,182 Posts
You don't define $A49 or $which before you try to use it. Add this to the top of your script:

$A49=isset($_POST["A49"])?intval($_POST["A49"]):0;

$which=isset($_POST["which"])?intval($_POST["which"]):0;

~Wonder
 

·
Banned
Joined
·
10,763 Posts
Discussion Starter · #14 ·
If I switch to , I'll see the input names and values on the address line, but the php code doesn't pick them up.
 

·
Banned
Joined
·
10,763 Posts
Discussion Starter · #15 ·
Add it to the php section or the html section. I thought A49 was defined when I did

And how come it works fine without that line, on my web host co's server? Try it; it works. http://shakahara.com/pitch.php

And what exactly does $A49=isset($_POST["A49"])?intval($_POST["A49"]):0;

mean, anyway. How do I look up what isset, $_POST, and ?intval mean. And i'm totally confused by the colon and the 0, or is it a O. I guess it's a 0.
 

·
Registered
Joined
·
1,182 Posts
Quote:
Originally Posted by soilman View Post

Add it to the php section or the html section. I thought it was defined when I did
PHP puts all form elements submitted via post in an array called $_POST. My code takes the values from the $_POST array and puts them into variables you want to use. Your webserver might use an old version of PHP which did not do this even though it's less secure. Add my code the the top of the PHP section and your code should run perfectly.

~Wonder
 

·
Banned
Joined
·
10,763 Posts
Discussion Starter · #17 ·
I intentionally downloaded the same version number of php that my web hosting company uses (acc to its cpanel). 4.4.4. Only mine is for windows. Theirs is for Linux.
 

·
Banned
Joined
·
10,763 Posts
Discussion Starter · #18 ·
OK, so you told me what $_POST[variablename] means -- but I still don't understand isset, ?intval, and ":0". That last is the most confusing, as I would't know how to start looking up what colon means.
 

·
Banned
Joined
·
10,763 Posts
Discussion Starter · #19 ·
Also, I don't want to confine the frequency value to an integer value. I want to make it so that someone can, for example, put in a value of 440.3 hz in the top box, and not have the .3 lopped off.
 

·
Banned
Joined
·
10,763 Posts
Discussion Starter · #20 ·
Yes I checked that your line of code worked, wonder. But I was going by webmonkey, which mentioned no such code.

http://webmonkey.com/webmonkey/01/48...tw=programming

Ok so all i really need is $A49=($_POST["A49"]);

Or I could rename the variable on the left if I like.

$myfrequencychoice=($_POST["A49"]); and use $myfrequencychoice in the loop below, instead of A49.

Ive figured out what isset and intval do -- but not the question mark, and the colon and the 0 at the end.
 
1 - 20 of 38 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top