MIST 5990 - Zlatko Unger's PHP Experience

Friday, November 24, 2006

Redesign = done

Well, all the pages have been converted.

As it turns out dealing with visual basic embedded pages was not that bad. Its time to get crazy and have some fun with all the things I learned from the book.

Go here --> http://ugasmis.org/indexN.php

Thursday, November 23, 2006

Batman and Robin aint got nothing on this.

You can use simple PHP like the include statement to get a file imported into a file. For example all the pages of the redesign have this going on. I thought you can only do PHP files, but appartently HTML files work too. There is a little stuff that is lost in translation, as the original file (.php) has to be in the same directory as the imported file in order for the links to work, unless the links are based on root level.

Here is the command:

<? include("announcements.php"); ?>
Now, lets say we are working on time.php wich is in the root level of the site.

Ex: www.ugasmis.org/time.php

time.php has a include statement that states
<? include(" http://www.ugasmis.org/rphoto/rd2003/noflash.html"); ?>
Now, the html from noflash.html will be imported, but the links won't work since time.php is not in the rd2003 directory. Once moved there the page starts to work. Ofcourse, there are breaks that need to be avoided as this is not like the iframe script, but rather imports the html dynamically into the requestiong page. Check it out:



Notice how the SMIS logo works, but the images for the thumbnails do not.

The page its loading is: http://www.ugasmis.org/rphoto/rd2003/noflash.html





PS:
I'm about 85.6% done converting the site to the new template...

Sunday, November 19, 2006

Oh what fun errors are!

So I have been updating page by page. I finally got to the resume page, and then I get a nice error:

Parse error: parse error, unexpected $end in C:\Domains\ugasmis.org\wwwroot\resumeN.php on line 287


Lets see how long it takes me to figure this one out.

Also I decided to keep the current Visual Basic, but rather implimenting it on the page, I added a button to open the visual basic file in a new window.
The system seems to work this far.

Thursday, November 16, 2006

Poof ! Visual Basic is lame!

So, this guy who coded UGASMIS is brilliant.

Where he coded in PHP for the most part, he used Visual Basic for the members page. Why?

I have no idea why. Given that the Visual Basic page is the one that has been giving people erros I have to remove some components.

In other news, I updated the template and every page updates with it.

I'm still working on converting the website. I think most of the new php will be involved in the main page as its the one that needs most coolenss factor.

Wednesday, November 15, 2006

Redoing the template.

After trying get everything to work, for some strange reason i cant get the width of the webpage to be contant throughout the page. for example the index, officers and alumini pages would all expand to their own liking

this pisses me off ... grrrr


so the latest thing i am doing is working on the width so that all php objects can take their space and not screw up the layout

hopefully adding 100 pixels horizontally will solve the problem

Tuesday, November 14, 2006

Rewriting crappy designed PHP = bad idea.

So, after rewrintg a lot of php and then finding out it does not work because:

1. it does not connect to the database
2. it looks in the wrong file
3. it does not assume that the tables in a database are connected
4. variables do not match since one is a nulll
5. the book explains one way of doing it, the database is designed in an obsolete way


So after I figured out all these things, I decided to modify the current PHP so that it works right, and has comments. For example :

$query = "select * from meetings where meeting_date >= '$timetime' order by meeting_date asc"; //it used to be greater than = to

I also had to make sure that the variables were actually comming back. Echo statement to the rescue. Ex:

//$tempvar = mysql_num_rows($result); error here ... returns a 0
//echo"$tempvar";


Anyway, I am off to import the old pages into the new design so that I make sure that everything works! Hooray!

Monday, November 06, 2006

Errors ... damn you....

Ok, so for the past few days I have been working on some code, trying to get the layout working and all, but I keep getting errors.

Sure this would be easy to fix, but it just tells me that there is something wrong with line 4. However the same code works perfectly in the current version of the site, so I have to ask my self what the heck is going on.

I have been bugging and debuggin way too much. I need a break from this insanity. Perhaps I will focus on some different aspects of the site and try again at the end of the week.