|
The Solution!
Missing Session Variables?
Faith Baptist Church
What happened? I developed the application. Then when I went to deploy,
the session variables started disapearing during application use.
Oops! I narrowed the problem down to Netscape. What I realized was the application, as was suppose
to, generated dynamic HTML, but if image tags where generated without 'src=' containing a valid
image file, the session variables disappeared after 3 submit button clicks.
So, of coarse, the fix was to not generate the image tags if the src= parameter was going to be null.
Another problem arose which has similar effects and also generates the warning messages:
Warning: session_start(): Cannot send session cache limiter - headers already sent ...
Turns out that a non-printable character was imbedded at the top of the source code file. The only
way I could see it was to open the file with 'vi' on a Linux server. With 'vi', I could remove the non-printable
character. The only way to remove it in Windows was to create a new file and then cut'n paste all of the
code to the new file. The cut'n paste function does not drag the non-printable characters to the new file.
A similar problem occurred, where the $_SESSION variables would disappear after a redirect call using the
header("Location: /URL"), so I removed the :
if ($_SESSION['useraccess']=="root")
header("Location: /URL")
and replace with:
$access=$_SESSION['useraccess'];
if ($access=="root")
header("Location: /URL")
Another Sessions bug occurs in older versions of IE 6, where the number of session variables cannot exceed 20. If
20 is exceeded, the session ID gets deleted.
FileZilla Passive Mode Failed to Display the Directory Listing?
Avannis
Setting up an FTP server on a desktop should be pretty staight forward. When I tried
to login, I was able to connect, but FileZilla would give me a 'Could not retrieve directory listing' error.
After researching several website about the problem, we came to understand that MicroSoft Windows OS's
use passive mode FTP transfers. The passive mode feature allows clients to connect to port 21 and then routes
the client to a new port for data transfers.
To simplify the effort, we needed to remove all unknowns. So, first we set up the fileZilla server to allow
passive connections. Then
we designated some ports, say 25001-25010. We also gave the desktop server itself an internal static IP, such as 192.168.1.125 .
Next, we turned off the firewall on the server, and tested the connection from inside the firewall. After
the connection proved successful, we turned the firewall back on and demonstrated a successful connection.
With the fileZilla server configured and accessable while the firewall was operating, we then focused on
the router, which happened to be a Linksys. We configured the Linksys router to allow port 21 connections
externally, which are re-directed to connected to IP address 192.168.1.125 port 21. Because of passive mode data ports,
we had to also allow the Linksys to forward port requests for 25001-25010 to 192.168.1.125 port range
25001-25010 .
Last but not least, we discovered while watching the FileZilla client connection logs that the FileZilla
server was directing passive ports successfully, but was attaching the internal IP, 192.168.1.125 to the
client re-direct response for data transfers. After a little more research, we discovered that we needed to select the
'Use this external IP' option in the FileZilla server, under the passive mode configuration and enter
our internet provider static IP address.
Walla, we have lift off!
We needed to tackle the math:
Chain Lakes Motel
How can I calculate the original amount of a sale transaction if all I have
is the sales tax rate and the sale final total?
We have wrestled with this calculation for months. I could not find a college math book and we
searched the web, and could not find even a hint. Finally, we bit the bullet and sat down for 3 1/2
hours to find the solution. This is what we found:
Let's assume we have a total owed price of 105.50 and a sales tax rate of 5.5%:
P - sale final total, $105.50
R - sales tax rate, 5.5% (.055)
X - orignal pre-tax sale amount
X = (P-(P * R)) + ((P-(P * R)) * R) - (((P-(P * R)) * R) * R)
X = (105.50-(105.50 * .055)) + ((105.50 * .055) * .055) - (((105.50 * .055) * .055) * .055)
X = (105.50-(5.8025)) + ((5.8025) * .055) - (((5.8025) * .055) * .055)
X = (99.6975) + (.3191375) - (.0175525)
X = 99.9999 (Rounding to the penny would be $100)
The calculation is accurate to the 10000th digit. If more accuracy is needed with larger numbers, simply
add 1 more iteration: ((((P-(P * R)) * R) * R) * R)
For the tax amount, simply reverse the 2nd and 3rd iteration.
|
|