ik snap het niet...
Het volgende probleem. Studiegenoot van mij heeft een schone installatie van Win2K/Apache 1.3.2+beetje / PHP4.20 / Mysql 3.23 draaien....
werkt perfect
MAAR nu komt de clou, zodra een script (wat we voor het college hier gebruiken gedraait wordt (een aantal databases moet installen)) wordt ge-submit geeft ie een 403 ??
Ik zelf heb mijn werkende httpd.conf en php.ini al overgezet: helaas..
Ik zelf heb op zijn pc alles geinstalled: helaas..
Nu komt het hele vreemde, als ik lekker via PHPMyAdmin aan de gang ga, no problem?!??! (lekker proggie is dat toch
)
heeft iemand enig id hoe dit zou werken?
Het script wat dus niet werkt:
BVD!
Het volgende probleem. Studiegenoot van mij heeft een schone installatie van Win2K/Apache 1.3.2+beetje / PHP4.20 / Mysql 3.23 draaien....
PHP:
1
| <?phpinfo();?> |
werkt perfect
MAAR nu komt de clou, zodra een script (wat we voor het college hier gebruiken gedraait wordt (een aantal databases moet installen)) wordt ge-submit geeft ie een 403 ??
Ik zelf heb mijn werkende httpd.conf en php.ini al overgezet: helaas..
Ik zelf heb op zijn pc alles geinstalled: helaas..
Nu komt het hele vreemde, als ik lekker via PHPMyAdmin aan de gang ga, no problem?!??! (lekker proggie is dat toch
heeft iemand enig id hoe dit zou werken?
Het script wat dus niet werkt:
PHP:
1
| <?//script to install databases for php/mysql book//to_install is the name of the database//filename are in the form dbname.dumpmysql_connect("localhost", "nobody", "") or die ("<h3>Before Installing your Databases you must have MySQL installed and provide a valid host,username, and password in line two of the install.dbs file.</h3>");$all_dbs = array ("guestbook2k", "catalog", "discussion","netsloth", "survey", "tracking");if(isset($submit)){ $to_install = array(); if(isset($passed_dbs) && is_array($passed_dbs) && isset($install_all)) { echo "Let's try this again. This time, please select the databases you would like installed OR check Install All. Not both. Press the back button, please."; exit; } elseif (isset($passed_dbs) && is_array($passed_dbs)) { $to_install = $passed_dbs; } elseif (isset($install_all)) { $to_install = $all_dbs; } else { echo "Let's try this again. This time, please select the databases you would like installed OR check Install All. Press the back button, please."; exit; }// $path = $DOCUMENT_ROOT . "/book/install/"; foreach($to_install as $dbname) { //create and slect database mysql_query("drop database if exists $dbname") or die (mysql_error() . "Could not drop database $dbname "); mysql_query("create database $dbname") or die (mysql_error() . "Could not create database $dbname "); mysql_select_db($dbname); //files will come in the form dbname.dump //$file_to_parse = $path . $dbname . ".dump"; $file_to_parse = $dbname . ".dump"; if (!file_exists($file_to_parse)) { echo "Could not find '$file_to_parse'. Are your files placed properly? Please check"; exit; } if (!$fp = fopen($file_to_parse, "r")) { echo "Read of $file_to_parse failed. Please check permissions."; exit; } $contents = fread($fp, filesize ($file_to_parse)); fclose($fp); //parse out drop, create, and insert statments preg_match_all("/(DROP TABLE.*?);/s", $contents, $drop_statements); preg_match_all("/(CRE.*?);/s", $contents, $create_statements); preg_match_all("/(INSER.*?);[\n\r]/s", $contents, $insert_statements); foreach($drop_statements[1] as $query) { mysql_query($query) or die (mysql_error(). " drop table failed: $query."); } foreach($create_statements[1] as $query) { mysql_query($query) or die (mysql_error(). " create table failed: $query."); } foreach($insert_statements[1] as $query) { mysql_query($query) or die (mysql_error() . "insert failed: $query."); } echo "database \"$dbname\" successfully created.<br>\n"; } }else{?><h2>Welcome to the Applications for MySQL/PHP Applications Book</h2><p>If you are seeing this, you have PHP and MySQL installed and talking to each other. Cool</p><p>To get the applications working, you first need to install the databases with the sample data. Belowplease choose the databases you would like installed. Choose the individual databases or mark InstallALL.</p><p><b>NOTE: If you have databases by the same name on your MySQL server they will bedeleted! Beware.</b></p><p>Databases to install:</p><form action = <? echo $REQUEST_URI; ?> method="get"> <? foreach($all_dbs as $dbname){ echo "<input type=\"checkbox\" name=\"passed_dbs[]\" value=\"$dbname\">$dbname<br>\n"; } ?> <br> <input type="checkbox" name="install_all" value="yes">Install All<br> <input type="submit" name="submit" value="Submit"></form><? } ?> |
BVD!
Gekkie is a proud member of TheBenny!