-
Posts
3,584 -
Joined
-
Last visited
-
Days Won
3
Everything posted by JonnoTheDev
-
In front of me at the moment I have: PHP Web 2.0 Mashup Projects - PACKT Guide to PHP Design Patterns - php|architect nanobooks Learning Perl - O'Reilly Bookshelf here at work: MySQL Database Design and Optimization - Apress Advanced PHP Programming PHP Cookbook - O'Reilly PHP 5 Recipes - Apress Webbots, Spiders and Screen Scrapers - Schrenk Beginning PHP 4 - Wrox Instant ASP Components - Buczek E-Commerce Programming with ASP - Sams Search Engine Optimization with PHP - Wrox Linux Run Your Own Webserver with Linux & Apache - Sitepoint Professional Apache 2.0 - Wrox PHP4 Multimedia Programming - Wrox Linux Quick Fix Notebook - Harrison Lots of others at home but cant remember them all: The Mythical Man Month Code Complete - Microsoft Programming
-
Call of Duty Modern Warfare 2
-
You dont want to be grabbing any remote data every time a user hits the site, this is a poor design. if the remote data is unavailable or there is a slow http response the user could be sat there for a long time or get errors. If you have many users hitting the site then why grab the same data over and over. Like I said. Have a cron job script that polls the data, parses it and records it to a database. The users on the website should view the data from the database via a simple query.
-
It is definately your processing logic! You should seriously redesign this process. Once you poll the data you should store in a database, NOT text files which are then parsed when a user hits your website. You script is highly inefficient in the way you are parsing text files.
-
You can do this without cURL. <?php function httpHeader($server) { $fp = @fsockopen($server,80,$errno,$errstr,30); $out = "GET / HTTP/1.1\r\n"; $out .= "Host: $server\r\n"; $out .= "Connection: Close\r\n\r\n"; @fwrite($fp,$out); $content = @fgets($fp); if(strstr($content, "200") || strstr($content, "302")) { return true; } return false; } if(httpHeader("www.google.com")) { print "url ok"; } else { print "bad url"; } ?>
-
HTML in business logic is bad in my opinion. It should be completely separated. The main reason for this is that if you are working in a team where there are developers and designers and you the developer writes code like this you are expecting the designer to also understand code so that they can ammend the website template. Designers should work with templates only and not delve into your business logic.
-
This may not be php. It could be your web servers maximum execution time. CLI php will not time out. It will terminate if you script exhausts the maximum memory allowance. You cannot perform a file upload through CLI php. File uploads are achieved through HTTP. The file is processed once on the server by php.
-
Not got the grindr app running have you? LOL
-
What progamming language do i need to run a .exe file?
JonnoTheDev replied to DarrenReeder's topic in Application Design
Of course but how are you going to know that -
Save the following as test.php and run on your server: <?php // process form $errors = array(); if(isset($_POST['submit']) && $_POST['submit'] == 'go') { if(!strlen(trim($_POST['name']))) { $errors['name'] = true; } if(!count($errors)) { // no errors } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <form methoid="post" action="test.php"> <?php if($errors['name']) print "<p>Please enter your name</p>"; ?> Name: <input type="text" name="name" size="50" maxlength="50" /> <input type="submit" name="submit" value="go" /> </form> </body> </html>
-
If you are submitting the form to the same page then it will remain on that page unless you are submitting to a different file or using a header to redirect. You should not use javascript to display errors when you are using a server side script to validate, you will just see a blank screen with an alert box, the user will click ok and the page will be outputted. A simple bit of text near the input box where the user made the error is much better. If you use Javascript to display errors then you should use Javascript to validate the form! Although you should still have server side validation as users can simply switch javascript off.
-
This is a nonsensical question. I strongly suggest you learn what OOP is. For a kick off it is not language specific.
-
Why are you using PHP to display Javascript. PHP is server side so it will process the code prior to it getting to the user. Javascript should be client side so use an event handler i.e <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>test</title> <script language="javascript"> function doSomething() { alert('did you see what I did'); } </script> </head> <body> <a href="#" onClick="doSomething()">Click Me</a> </body> </html> If you are using a form set the action to run your javascript validation function.
-
The best tutorial is to download their PHP SDK and go over the examples. On a side note if you are taking Maestro cards you will also need to integrate 3D Secure provided by Cardinal Commerce. This is tricky but they also have an SDK with examples. Information should be provided by Paypal.
-
I think we are all a bit nuts!
-
What progamming language do i need to run a .exe file?
JonnoTheDev replied to DarrenReeder's topic in Application Design
If you saw a link like that, you would have to be mad to click on it for obvious reasons. -
<?php $path = "../emails/ama/images/headers/"; $handle = opendir($path); $files = array(); // build an array of files while($file = readdir($handle)) { if($file != "." && $file != "..") { $files[] = $file; } } // sort the array sort($files); // loop through and populate the select list foreach($files as $file) { echo "\t<option value='#/ama/images/headers/".$file."'>".$file."</option>\n"; } ?>
-
http://www.phpfreaks.com/forums/index.php/topic,294324.msg1393195.html
-
Hardware issue: monitor colors are slightly off
JonnoTheDev replied to gwolgamott's topic in Miscellaneous
One of the ports is VGA and the other is DVI-I so I guess you are using a converter on the second. Have you tried testing both monitors on the normal VGA output one at a time to see if the display is identical? Now do the same with the DVI-I connection (setup as primary display first). If they differ then it could be a simple converter or cable issue. If the monitors differ on the same output then it is the monitor settings or a faulty monitor. -
Use a LEFT JOIN rather than a straight JOIN as this will only return matching records.
-
You can add the count in yourself with a left join SELECT DATE_FORMAT(date_added, '%M %Y') AS fulldate FROM tablename GROUP BY DATE_FORMAT(date_added, '%m-%y') ORDER BY date_added DESC
-
http://www.phpfreaks.com/forums/index.php/topic,294324.msg1393195.html
-
I really want to punch Justin Bieber in the face!
JonnoTheDev replied to Orionsbelter's topic in Miscellaneous
I might have done if I knew her, mind you she would have only been 8 when I was 15. I wouldn't have minded asking Belinda Carlisle or kylie Minogue out though. -
I really want to punch Justin Bieber in the face!
JonnoTheDev replied to Orionsbelter's topic in Miscellaneous
Aren't all teenagers? I remember being a know it all cocky little git who used to tell my parents to shut up all the time cos they knew nothing. -
http://www.thevoiceofreason.com/uk/WorldsFunniestJokes/CaptchaHumour.htm