Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. How come you cant open the error.log file? Just right click and select open with... then select Notepad or another editor from the list. If your getting a 500 error it means that Apache has an error and so you get that very unhelpfull 500 error. Does PHPTriad come with Documentation? IF so see if there is anything in there that may sort out the 500 error. I dont use PHPTtriad I just Install Apache, PHP and MySQL manually, much better I reckon than an all-in-one package. If you can't get pHPTriad to work then unistall it and try Apache2Triad or WAMP/XAMPP
  2. Heres a tip for you guys. If you can't post your PHP code here. then copy 'n' paste your php code over at [a href=\"http://pastebin.com/\" target=\"_blank\"]Pastebin.com[/a]. Copy and paste your code into the form on the main page then fill in the name box and click Submit. Once your code has been submitted it'll be shown all highlighted and lined numbered. Now copy the link in the address bar to here then just refer to link rather than posting your code when posting about your problem. Hope that helps. Heres an example: [a href=\"http://pastebin.com/651488\" target=\"_blank\"]http://pastebin.com/651488[/a] This link will show my posted code.
  3. Are you trying to view your .htaccess file when you go to [a href=\"http://localhost/\" target=\"_blank\"]http://localhost/[/a] and then from the list of files find your .htaccess file? If so then Apache hides these files. If you want it to be viewable then commnent out the following: [code]<Files ~ "^\.ht">     Order allow,deny     Deny from all     Satisfy All </Files>[/code]So its just: [code]#<Files ~ "^\.ht"> #    Order allow,deny #    Deny from all #    Satisfy All #</Files>[/code] Now save and restart Apache. You should be able to see your .htaccess file listed with all your other files. Even though yoiur .htaccess file is not viewable APache will still use the .htaccess file it just hides it from users for security purposes as it can contain private information which you may not want your visitors to see.
  4. Your if/elseif statment is a little wrong it should be this: [code]if ($_POST['user'] == 1 ) { } else if ($_POST['user'] == "student" ) { }[/code] What is the code you use for your [i]<SELECT name=...>, <OPTION value=...>[/i]? It show be something like this: [code]<select name="user">   <option value="student">Student</option>   <option value="tutor">Tutor</option> </select>[/code]Then your if/elseif statment should look like this: [code]if ($_POST['user'] == "student" ) {     //code for student } else if ($_POST['user'] == "tutor" ) {    //code for tutor }[/code]
  5. Your form is submitting, but to its self! You will need something like this: [code]<?php if(isset($_POST['year'])) {    echo "Your have chosen: " . $_POST['make'] . " as the make, " . $_POST['model'] . " as the model, and " . $_POST['year'] . "as the year!"; } ?>[/code]If you wish to show what has been submitted.
  6. Should the variable $getHex only contian one result? If it should then dont use a while loop, otherwise if $getHex has 2 or more results the while loop will loop 2 or 3 more times depending on the number of results $getHex returns from the previous MySQL query. And so you get duplicate results. Strip the while loop out and use this instead: [code]$hex = mysql_fetch_array($getHex);[/code] Also dont for get to change this: [code]   $Result1 = mysql_query($hexinsert, $Norwold) or die(mysql_error()); }[/code]to: [code]   $Result1 = mysql_query($hexinsert, $Norwold) or die(mysql_error());[/code] That way your code will execute just one.
  7. PHP is processed by the server and so a request must be made to the server for the PHP to be processed. You cannot run a PHP function as soon as you click a link, like you can do with Javascript. However you can do this with the aid of AJAX. Head over to AJAXFreaks.com for more info on AJAX or by going through the [a href=\"http://www.ajaxfreaks.com/tutorials/1/0.php\" target=\"_blank\"]AJAX Introduction tutorial[/a]. That is the only way to do what you want to do.
  8. I would recommend you this DOCTYPE: [code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">[/code] You can get more DOCTYPES [a href=\"http://www.w3schools.com/tags/tag_doctype.asp\" target=\"_blank\"]here[/a] It doesn't mater what DOCTYPE you have those errors won't go away as your HTML syntax is in fact invalid in some places. To check out any errors with your html head over to the [a href=\"http://validator.w3.org/\" target=\"_blank\"]HTML Validator[/a]. This will show up any problems with your current HTML syntax and ways to correct the errors too. Also I am moving this to the HTML Help forum.
  9. Did you restart Apache? after making the changes and made sure there wasn't any #'s in front of the lines you edited if ther is then remove the # as these are comments and so APache ignore these lines. Now save the httpd.conf file and restart Apache. Also make sure your .htaccess folder in the root of the folder thgat stores your files to be seen by the webserver.
  10. Did you run the php installer if you did that would of done nothing, apart from extract the files from installer to installation folder you specified, most probably C:\php In order to get your pages to work you will need to configure Apache so it uses PHP as Module which is easy to do. You will need to find the Apache config file which is called httpd.conf. Open that file up for editing in Notepad or what ever editor you wish to use. And scroll downwards until you come across the following: [code]#LoadModule ssl_module modules/mod_ssl.so[/code] You will need to add the following line to after the line stated above: [code]LoadModule php4_module ""C:/php/php4apache2.dll"[/code] Now directly after that line add the following: [code]#PHPIniDir PHPIniDir "C:/php"[/code] You're almost done. Now scroll down and find the following line: [code]DirectoryIndex index.html index.html.var[/code]Now add a space a after index.html.var and type index.php so the DirectoryIndex line should look like this: [code]DirectoryIndex index.html index.html.var index.php[/code] Now scroll down a little further and find the following: [code]AddType application/x-gzip .gz .tgz[/code]Now add the following directly after it: [code] #PHP5 AddType application/x-httpd-php .php .phtml AddType application/x-httpd-phps .phps[/code] You have now configured APache to use PHP as an Apache Module. Now save the httpd.conf file ie File -> Save or Ctrl+S for short. After changing the httpd.conf file go to where you have installed PHP to, which I presume is C:\php, and go to a folder called [b]sapi[/b] (C:\php\sapi) now move a file called [b]php4apache2.dll[/b] to the root of the PHP folder (C:\php\). ANother step is to rename a fiole called php.ini-recommend to just php.ini (only if a file called php.ini is not there). Once you have followed the steps above. You will need to restart Apache for the changes to take affect. To do so there should be an icon in the lower right hand corner of the screen in the taskbar with a small green triange inside a white circle pointing to the right and a purple feather pointing upwards to the left. If you do click it and Select Apache 2 from the menu and then select Restart. Apache should restart and attempt to apply the changes made to the httpd.conf file. If apache doesn't come up with a warningthen you have successfully configured Apache and PHP to work together. Now go to [a href=\"http://localhost/\" target=\"_blank\"]http://localhost/[/a] in web browser and find your .php file. Click it and the output of the file should be displayed in the browser window. If no .php files are listed in the directory index when you go to [a href=\"http://localhost/\" target=\"_blank\"]http://localhost/[/a] you will need to move your .php files to the folder where you store your files be seen by the webserver. Hope that helps.
  11. You need to change the [b]AllowOverride[/b] setting to [b]All[/b] which is located near line 280 in the httpd.conf file. The following is what you'll want to look for: [code]# # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: #   Options FileInfo AuthConfig Limit #     AllowOverride[/code] Now save your httpd.conf file and restart Apache. You should beable to use .htaccess files.
  12. Simple: [code]$str = "String<br />with <br />line breaks<br />"; $str = str_replace("<br />", "", $str); echo $str;[/code]
  13. Your MySQL query is completly wrong! Are you updating a table row? If so you'll want to use this syntax: [!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']UPDATE[/span] table_name SET column_name [color=orange]=[/color] new_value [color=green]WHERE[/color] column_name [color=orange]=[/color] some_value [!--sql2--][/div][!--sql3--] The following should work: [code]$username = addslashes($_POST[#username']); $q = "UPDATE users_table SET user_session='(sessionid)' WHERE userid='$username'";[/code] You'll need to change user_table to the actual name of the table your are updating. Also chnage user_session to the coloumn name that holds the sessionid for the users. And change (sessionid) to the actually value of the sessionid.
  14. Look for a file called [b]error.log[/b] as it'll have more information in there. NOTE: The most recent error(s) will be written at the bottom of this file. error.log should be located somewhere around whe you installed PHPtriad.
  15. If you'e using IIS I think you need to set permissions, but I dont know what type of permissions. Sorry. I know my post aint a lot of help but prehaps if you read through [a href=\"http://www.php.net/manual/en/install.windows.iis.php\" target=\"_blank\"]this[/a] it may help with your problem.
  16. I do not understand your question. Do you want the value of your checkbox to go to your link when selected? If so this is not possible with PHP.
  17. Then change this: [code] <div align="left"><a href="mailto:<?php if($row_rsalumni_database1['display_email'] == "Y") { echo $row_rsalumni_database1['address_email']; } ?>"><?php echo KT_FormatForList($row_rsalumni_database1['fullname'], 20); ?></a></div> [/code] to: [code]<?php if($row_rsalumni_database1['display_email'] == "Y") {     echo '<div align="left"><a href="mailto:' . $row_rsalumni_database1['address_email'] . '">';     echo KT_FormatForList($row_rsalumni_database1['fullname'], 20) . '</a></div>'; } ?>[/code]
  18. [!--quoteo(post=362628:date=Apr 7 2006, 08:17 PM:name=AdamPGT)--][div class=\'quotetop\']QUOTE(AdamPGT @ Apr 7 2006, 08:17 PM) [snapback]362628[/snapback][/div][div class=\'quotemain\'][!--quotec--] The Options are being generated dynamically using PHP/JS.....even after looking at the page source when everything has been created no <option> tags show up. --Adam [/quote]In that case then there is a problem with your PHP or Javascript that creates the <option></option> tags as they are not being generated! Could you provide a link for the page has a problem so we can see how your Javascript. Also could you tell us how you are generating your <option> tags with pHP/Javascript.
  19. Basically that error messahge is saying your are declaring the Template class twice. Which you cannot doas you can only declare one class once. If you want to modify the Template class then you'll want to do something like: [code]class Template2 extends Template { // class code here }[/code]
  20. The do an if statement like so: [code]<?php if($row_rsalumni_database1['display_email'] == "Y") {     echo $row_rsalumni_database1['address_email']; } ?>[/code]
  21. Is PHP installed on Windows server and do you have access to the server files, ie the PHP root folder. If you do then just download the Windows Binaries version from PHP.net, or just click the following link: [a href=\"http://www.php.net/get/php-4.4.2-Win32.zip/from/a/mirror\" target=\"_blank\"]PHP 4.4.2 zip package[/a]. The extract all the contents of files to where you have your current PHP install. If you are promt to overwrite files overwrite all of them. This should upgrade your current version to PHP4.4.2. However there isn't much different between the two version as generally only bug fixes and few updates are included in PHP4.4.2. So your script should work with PHP 4.3.11 if your not on Windows then you'll you'll need to download and compile PHP4.4.2 in order to upgrade.
  22. Have you learn't HTML? As if you did you should know where to put it as its the first thing you learn about HTML! If you look below. That is what a basic webpage should be coded like. [code]<html> <head>   <title>Your Page Title Here</title> </head> <body>   Your webpage content goes here </body> </html>[/code]
  23. If you are using this code: [code]<?php echo "Testing :\n"; echo "A new line"; ?>[/code]and viewing the page in a web browser then it wont show like so: Testing : A new line However it will if you go to View -> Source Code in your web browser. Web browsers ignore whitespace characters such as \n, \r \t etc. This is why your text appears in one line. To resolve this you will have to tell your browser to put in a new line after Testing: . Using the line break tag manualy. Or you could do this: [code]<?php $str = "Testing: \n A new line"; echo nl2br($str); ?>[/code]With nl2br it doesn't mater whether you use \r or \n as it will convert both into <br /> automatically. However if you are writting the output to a file you will need to use \r\n for Windows, \r for Mac and \n for Linux as others have pointed out above.
  24. Im not sure why your're getting the error you're recieving. Could you change your MySQL conntect code to this: [code]$sql = mysql_connect('localhost','root') or die("Cannot Connect to MySQL: " . mysql_error());[/code] Did you get a different error message this time? If so could you post the full message here.
  25. There is nothing wrong with your PHP, but mainly to do with your Javascript. By looks of things iot the onMouseOut part that isn't working correcty. However the only mouse over that does work is the last one. SO I'd post your Javascript in the Javascript Help forum. EDIT: Argh! I know why it doesn't work now. It is becuase in your nav.php file you are repeating your self. As you have tweo lots of the same javascript. Clear out your nav.php file and so its just this: [code]<table border="0" cellpadding="0" cellspacing="0">   <tr>     <td width="215" bgcolor="#FFFFFF"><a href="Inside_Pictures.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Inside Pictures','','images/nav1_over.jpg',1)"><img src="images/nav1.jpg" alt="Inside Pictures" name="Inside Pictures" width="215" height="38" border="0"></a></td>   </tr>   <tr>     <td bgcolor="#FFFFFF"><a href="Swimming_Pool.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Swimming Pool','','images/nav2_over.gif',1)"><img src="images/nav2.gif" alt="Swimming Pool" name="Swimming Pool" width="215" height="31" border="0"></a></td>   </tr>   <tr>     <td bgcolor="#FFFFFF"><a href="Torrevieja.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Torrevieja','','images/nav3_over.gif',1)"><img src="images/nav3.gif" alt="Torrevieja" name="Torrevieja" width="215" height="27" border="0"></a></td>   </tr>   <tr>     <td bgcolor="#FFFFFF"><a href="La_Plaza.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('La Plaza','','images/nav4_over.gif',1)"><img src="images/nav4.gif" alt="La Plaza" name="La Plaza" width="215" height="29" border="0"></a></td>   </tr>   <tr>     <td bgcolor="#FFFFFF"><a href="La_Zenia_Beach.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('La Zenia Beach','','images/nav5_over.gif',1)"><img src="images/nav5.gif" alt="La Zenia Beach" name="La Zenia Beach" width="215" height="28" border="0"></a></td>   </tr>   <tr>     <td bgcolor="#FFFFFF"><a href="Spainish_Golf.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Spainish Golf','','images/nav6_over.gif',1)"><img src="images/nav6.gif" alt="Spainish Golf" name="Spainish Golf" width="215" height="29" border="0"></a></td>   </tr>   <tr>     <td bgcolor="#FFFFFF"><a href="Things_to_do.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Things to do','','images/nav7_over.gif',1)"><img src="images/nav7.gif" alt="Things to do" name="Things to do" width="215" height="30" border="0"></a></td>   </tr>   <tr>     <td bgcolor="#FFFFFF"><a href="Local_Markets.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Local Markets','','images/nav8_over.gif',1)"><img src="images/nav8.gif" alt="Local Markets" name="Local Markets" width="215" height="28" border="0"></a></td>   </tr>   <tr>     <td bgcolor="#FFFFFF"><a href="Photo_Gallery.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Photo Gallery','','images/nav9_over.gif',1)"><img src="images/nav9.gif" alt="Photo Gallery" name="Photo Gallery" width="215" height="26" border="0"></a></td>   </tr>   <tr>     <td bgcolor="#FFFFFF"><a href="Rental_Fees.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Rental Fees','','images/nav10_over.gif',1)"><img src="images/nav10.gif" alt="Rental Fees" name="Rental Fees" width="215" height="33" border="0"></a></td>   </tr>   <tr>     <td bgcolor="#FFFFFF"><a href="Flights.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Flights','','images/nav11_over.jpg',1)"><img src="images/nav11.jpg" alt="Flights" name="Flights" width="215" height="44" border="0"></a></td>   </tr>   <tr>     <td bgcolor="#FFFFFF"><a href="Maps.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Maps','','images/nav12_over.jpg',1)"><img src="images/nav12.jpg" alt="Maps" name="Maps" width="215" height="58" border="0"></a></td>   </tr>   <tr>     <td bgcolor="#FFFFFF"><a href="Car_Rental.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Car Rental','','images/nav13_over.gif',1)"><img src="images/nav13.gif" alt="Car Rental" name="Car Rental" width="215" height="62" border="0"></a></td>   </tr>   <tr>     <td background="images/049_21.jpg" bgcolor="#FFFFFF"><a href="Enquiry_Form.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Enquiry Form','','images/nav14_over.jpg',1)"><img src="images/nav14.jpg" alt="Enquiry Form" name="Enquiry Form" width="215" height="38" border="0"></a></td>   </tr> </table>[/code] Your menu should work properly now.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.