First a little background: I’m very new to PHP. I’ve got a little HTML experience and some C++ experience but I’m learning PHP as I go. The site I am needing help with is the first PHP I’ve edited, and to further complicate things I inherited the site so I did not write the original code, nor do I have means of contacting the person that did (they are no longer employed by us).
On to the problem:
Currently I’m just working on revamping the overall look of the site (it was pretty awful). This has been far more painful then in a simple HTML site, since it’s nearly impossible for my untrained eyes to figure out what table or cell I seem to be editing. I am using Dreamweaver but it isn’t much help either. It doesn’t help that the PHP file is loaded with functions that do not help my brain process the order everything is in either. I actually think the code I need to edit is in HTML, but surrounded by the currently confusing PHP.
The site I’m working on can be found here: http://mmrp-formercampelliott-eastelliot.com/
The formatting issue I’m currently having (certainly not the first I’ve had) are the grey boxes that appear near the “References” menu. More importantly is the fact the boxes appear differently depending on which browser is being used. The site looks the most appropriate in firefox, while Internet Explorer adds an unwanted grey line under the Map image, and a dark grey area in the navigation bar above the map; and Chrome adds a grey box to the right and bottom of “References”.
Here’s the PHP for the site: (I apologize for it being so lengthy)
[php]
<?php if(!isset($_SESSION['_access_'])) { session_start(); session_regenerate_id(true); } function sanitize_paranoid($string) { $string = preg_replace("/[^a-zA-Z0-9!_. @-]/","",$string); return $string; } if(sanitize_paranoid($_GET['logout'])==1) { $_SESSION['njyur6543trwefgsbdhnfjr6u54yer']=""; } if ( (sanitize_paranoid($_POST['username'])=="ID_superadmin"&& sanitize_paranoid($_POST['password'])=="****") || (sanitize_paranoid($_POST['username'])=="Elliott-InDepth" &&sanitize_paranoid($_POST['password'])=="****") || (sanitize_paranoid($_POST['username'])=="Elliott-Stakeholders"&&sanitize_paranoid($_POST['password'])=="****") || (sanitize_paranoid($_POST['username'])=="Elliott-Accord"&&sanitize_paranoid($_POST['password'])=="****") || (sanitize_paranoid($_POST['username'])=="Elliott-USACE"&&sanitize_paranoid($_POST['password'])=="****") || (sanitize_paranoid($_SESSION['njyur6543trwefgsbdhnfjr6u54yer'])=="mkyui7u56y4ergsdfer3wt4y5u6") ) { $posted_correctly = "yes"; } if($_POST['username']) { if(sanitize_paranoid($_POST['username'])!=$_SESSION['iamthesuperadministrator'] ) {$_SESSION['iamthesuperadministrator'] = "";} } if(sanitize_paranoid($_POST['username'])=="ID_superadmin") {$_SESSION['iamthesuperadministrator'] = "ID_superadmin";} echo ' East Elliott
|
|||||||||||||
';echo '
|
|||||||||||||
';echo '
|
|
|
|||||||||||
';echo '
|
|||||||||||||
Username: |
|
Password: |
|
|
'; } function f_main() { echo ' Welcome
Welcome to the East Elliott Project Team Website. This website was designed as an information exchange site for Stakeholders, the Contractor Project Team and USACE. Use of this site is restricted to individuals with an authorized username and password. Please protect your password to prevent unauthorized use of this site.
Upcoming Events ';if ($_SESSION['iamthesuperadministrator'] == "ID_superadmin") { echo ' '; if ($_POST['calendar1']) { $message = $_POST["calendar1"]; $out = fopen("cal_data.php","w"); if (!$out) { print("Could not write to file"); exit; } fputs ($out,implode,("\n")); fwrite($out,"$message"); fclose($out); } echo ' '; $messagecontent = ""; $fp = fopen('cal_data.php','r'); if (!$fp) {echo 'ERROR: Unable to open file. |
Project Schedule
Project Schedule
'; } function f_project_documents() { echo ' Project Documents
'; } function f_reference_documents() { echo ' Reference Documents
'; } function f_maps() { echo ' Maps
'; } function f_photos() { echo ' Photos
'; } function f_contact() { echo ' Contact Us
Justin Stanley |
'; } function f_proweb() { echo ' Pro-Web Login
Email: | ||
Password: | ||
'; } echo ' '; ?>
[/php]
If it helps, here’s what the site use to look like:
https://www.mmrp-williams.com/
So you can see what I’ve changed…
Hope to hear from you guys.