Thursday, April 26, 2012
First I had to figure out how to host my word press theme off of my godaddy account.
This was found to be a difficult process at first. There are two seperate options that I am given at the beginning instalation, and that is to decide whether to use wordpress to host my site or another domain server. Since I am already paying for my site to be used on godaddy then I thought it would make the most sense to host it there. Also, from a edit-ability standpoint, it seemed as if templates become more customizable from this format.
After finding it to be difficult to make my wordpress compatible with my GoDaddy account I decided to host it on the Wordpress site and use the Wordpress Dashboard. Within the Wordpress Dashboard there are numerous options to edit anything from name to colors of the blog template that I chose. fcp 7 save
Problem solving log
-Getting my logo image to fit correctly so that it is not cut-off anywhere.
-I am worried about whether I am using the correct host for what I want the website to offer.
-It is in a blog host…but it is not a personal blog, is that okay? I want people to be able to share photos and videos on my website with forum ability.
-I have to provide all the content to start, as I am aware, and quite possibly will continue to provide unless girls really start kicking things off and getting edits in.
-image wise: I want the website to be very simple and I’m afraid Word press is going to just slam with weird fees whenever I want
will be working on the thumbnail image for nabbell today in photoshop.
-I can’t figure out how to download the Alba font from my hard drive and I just did it 2 weeks ago. Ugh. I ended up wanting to play around with the color or the logo and can’t make any headway.
Wednesday, April 25, 2012
Ankhet Mobile Problem Solving
Problem: I want to cache images, but not HTML
Solution: Modify headers sent from server for image data to clarify cacheability
Implementation: Not Done
Problem: Zoom works properly on iPhone but not on Kindle Fire
Solution: iPhone auto-creates a viewport from the beginning of the first visual component to the end of the last visual component. Kindle renders more or less like a desktop. Create a viewport for Kindle Fire.
Implementation: Viewport with minSize ~= 2.0 and maxSize ~= 3.0 with User-Scaleable = 1
Problem: mysql_real_escape_string requires a live connection to a mySQL database, so it can grab the character encoding. I don't have a mySQL database.
Solution: Use mysql_escape_string (deprecated, possible it'll be removed) or a dummy mySQL database with the same charset at the MSSQL database.
Implementation: Switched to MySQL 5.5 database backed by Sonic.net
Problem: Unable to use any mysql_, mssql_ or sqlsrv_ PHP functions with the default GoDaddy configuration (despite having databases for both mysql and MSSQL).
Solution: Switch somewhere that lets me finish my site.
Implementation: Call sonic.net. Get satisfaction in under 10 minutes.
Problem: Sonic.net doesn't support sqlsrv_ functions (linux based hosting) and mssql_ functions are deprecated.
Solution: Switch to a MySQL database, use the already extant mysql_ functions to interface with the database.
Implementation: see above.
Problem: default.php doesn't display at http://ankhet-mobile.net, instead a directiory of contents comes up.
Solution: Rename default.php to index.php.
Implementation: done (future: redirect index.php to default.php transparently, not done)
Problem: PHP pages are cluttered and contain large portions of if(bool) echo '[HTML CODE]';
Solution: Migrate HTML out of PHP
Implementation: Use include() to bring in HTML as needed, reducing page size, processing time and increasing readability.
Problem: HTML/PHP pages to be included are visible without being inside their including page.
Solution: Enforce inclusion over direct viewing.
Implementation: <?php if($_SERVER['PHP_SELF'] !== "[PAGENAME]") { header("HTTP/1.1 404 Not Found"); echo '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>404 Not Found</TITLE>
</HEAD><BODY>
<H1>Not Found</H1>
The requested URL '.$_SERVER['PHP_SELF'].' was not found on this server.<P>
<P>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.
<HR>
<ADDRESS>Apache/1.3.41 Server at [SERVER] Port 80</ADDRESS>
</BODY></HTML>'; exit; } ?>
Problem: Sessions dying on every page, requiring new login.
Solution: session_start() must be on every page.
Implementation: Put session_start() just after <?php in most cases, or use ob_start()
Problem: Sessions persist forever.
Solution: Add logout button
Implementation: <?php
ob_start();
session_start();
session_destroy();
header("Location: [FRONTPAGE]");
ob_end_clean();
?>
Problem: Registration and some other abilities need to be restricted to testing only.
Solution: A debug variable, put somewhere it'll always be available.
Implementation: Wrap the abilities in question in if (AnkhDEBUG) {} and define() AnkhDEBUG in ankhetdb.php as it's included on every page.
Problem: Registration dumps you back on the main page with no indication your registration worked
Solution: Auto-login if successful.
Implementation: Change $returnVal to an array() with [0] being success and [1] being message. If [0] start_session, header location: index.php else continue on register.php, displaying [1] as appropriate.
Problem(s): Lots of problems with getting data into the table.
Solution/Implementation: Print the query being sent, debug debug debug, make sure of use ` instead of ' when referring to MySQL tables/databases (MySQL idosyncracy)
Problem: game.php needs to require login
Solution: Check if user is logged in, otherwise redirect
Implementation: Check if a particular session variable exists, if not use the above header location: technique to redirect to index.php for session start.
Solution: Modify headers sent from server for image data to clarify cacheability
Implementation: Not Done
Problem: Zoom works properly on iPhone but not on Kindle Fire
Solution: iPhone auto-creates a viewport from the beginning of the first visual component to the end of the last visual component. Kindle renders more or less like a desktop. Create a viewport for Kindle Fire.
Implementation: Viewport with minSize ~= 2.0 and maxSize ~= 3.0 with User-Scaleable = 1
Problem: mysql_real_escape_string requires a live connection to a mySQL database, so it can grab the character encoding. I don't have a mySQL database.
Solution: Use mysql_escape_string (deprecated, possible it'll be removed) or a dummy mySQL database with the same charset at the MSSQL database.
Implementation: Switched to MySQL 5.5 database backed by Sonic.net
Problem: Unable to use any mysql_, mssql_ or sqlsrv_ PHP functions with the default GoDaddy configuration (despite having databases for both mysql and MSSQL).
Solution: Switch somewhere that lets me finish my site.
Implementation: Call sonic.net. Get satisfaction in under 10 minutes.
Problem: Sonic.net doesn't support sqlsrv_ functions (linux based hosting) and mssql_ functions are deprecated.
Solution: Switch to a MySQL database, use the already extant mysql_ functions to interface with the database.
Implementation: see above.
Problem: default.php doesn't display at http://ankhet-mobile.net, instead a directiory of contents comes up.
Solution: Rename default.php to index.php.
Implementation: done (future: redirect index.php to default.php transparently, not done)
Problem: PHP pages are cluttered and contain large portions of if(bool) echo '[HTML CODE]';
Solution: Migrate HTML out of PHP
Implementation: Use include() to bring in HTML as needed, reducing page size, processing time and increasing readability.
Problem: HTML/PHP pages to be included are visible without being inside their including page.
Solution: Enforce inclusion over direct viewing.
Implementation: <?php if($_SERVER['PHP_SELF'] !== "[PAGENAME]") { header("HTTP/1.1 404 Not Found"); echo '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>404 Not Found</TITLE>
</HEAD><BODY>
<H1>Not Found</H1>
The requested URL '.$_SERVER['PHP_SELF'].' was not found on this server.<P>
<P>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.
<HR>
<ADDRESS>Apache/1.3.41 Server at [SERVER] Port 80</ADDRESS>
</BODY></HTML>'; exit; } ?>
Problem: Sessions dying on every page, requiring new login.
Solution: session_start() must be on every page.
Implementation: Put session_start() just after <?php in most cases, or use ob_start()
Problem: Sessions persist forever.
Solution: Add logout button
Implementation: <?php
ob_start();
session_start();
session_destroy();
header("Location: [FRONTPAGE]");
ob_end_clean();
?>
Problem: Registration and some other abilities need to be restricted to testing only.
Solution: A debug variable, put somewhere it'll always be available.
Implementation: Wrap the abilities in question in if (AnkhDEBUG) {} and define() AnkhDEBUG in ankhetdb.php as it's included on every page.
Problem: Registration dumps you back on the main page with no indication your registration worked
Solution: Auto-login if successful.
Implementation: Change $returnVal to an array() with [0] being success and [1] being message. If [0] start_session, header location: index.php else continue on register.php, displaying [1] as appropriate.
Problem(s): Lots of problems with getting data into the table.
Solution/Implementation: Print the query being sent, debug debug debug, make sure of use ` instead of ' when referring to MySQL tables/databases (MySQL idosyncracy)
Problem: game.php needs to require login
Solution: Check if user is logged in, otherwise redirect
Implementation: Check if a particular session variable exists, if not use the above header location: technique to redirect to index.php for session start.
Thursday, April 19, 2012
Subscribe to:
Posts (Atom)