
rythemton
Members-
Posts
107 -
Joined
-
Last visited
Everything posted by rythemton
-
Building Your Own Server vs Using a Service
rythemton replied to thetylercox's topic in Application Design
Well, that's scary. He lost his job because he refused to Upsell during Tech Support Calls. He didn't feel that Upselling to people who are having problems with their current service was a good idea! -
Building Your Own Server vs Using a Service
rythemton replied to thetylercox's topic in Application Design
If you have the resources to run your own server, do it!!! Nearly all of the big web hosting companies are now owned by 5 major companies. These are probably the same parent companies that own most of the television stations: http://theeconomiccollapseblog.com/archives/who-owns-the-media-the-6-monolithic-corporations-that-control-almost-everything-we-watch-hear-and-read I've been with HostMonster for years, but I'm not sure how much longer I will be with them. They (and several others including BlueHost) were recently purchased by the same company that owns GoDaddy. I was just informed (by a former employee of BlueHost) that because GoDaddy is so successful, that all of the other hosting companies they own will begin following GoDaddy's model. They are blind to the fact that GoDaddy is so big because of advertisement! Further reason not to use GoDaddy, is their Domain Resell services. If you look up a Domain Name on GoDaddy's web site, if you don't purchase it right away, you'll find that the Domain has gone to one of GoDaddy's Domain Resellers. A friend lost 3 domains this way, and lost 2 more test domains that were looked up just to prove that GoDaddy was doing this on purpose! I say it again, if you have the resources, run your own server!! -
I'm afraid you are asking a very opinionated question here. It is really personal preference. As long as you're consistent on a per field basis, it really doesn't matter, IMHO. If your scripts expect NULL, and are getting NULL from the database, it will work. If your scripts expect Empty Strings, and are getting Empty Strings from the database, it will work. If your scripts expect NULL, and get Empty Strings, or vice versa, you'll have issues.
-
This is actually a problem with your encapsulation type in the form itself. You need to set the form to be a multipart encapsulation: <form enctype="multipart/form-data" action="yada.php" method="post"> The multipart is needed because you are dealing with binary data.
-
JavaScript function similar to PHP's include()?
rythemton replied to melting_dog's topic in Javascript Help
To include another JavaScript file, I've used something as simple as this: document.write('<script type="text/javascript" src="' + PathToScript + '"></scr' + 'ipt>'); If you want to include HTML, AJAX is most likely what you'll need to use. -
The problem is that you are returning a value before the next check. As soon as you return a value, the function ends. Try setting a default value, and changing it. Then you return it at the end, only once: function sampleFunction() { checkValue = true; if(form.aut_make.value==""){ document.getElementById("id_aut_make").innerHTML = "You must enter the make"; checkValue = false; // Here we are changing the check value because there are errors, but not 'return'ing anything yet. }else{ document.getElementById("id_aut_make").innerHTML = ""; } // Add the rest of the checks here. Setting the check value more than once won't hurt anything. return checkValue; }
-
Implementing Authentication with PHP and MySQL
rythemton replied to wolocaw's topic in PHP Coding Help
Here, you are trying to USE a variable that isn't set, so it gives you a warning: While here, you are checking to see if the variable is set, but not actually using it for anything: -
The data is showing properly in the database. A BLOB is a Binary Object, so it will not be human readable. All you have to do to display it is set the header to the proper type, and echo the contents of the retrieved field. Don't output anything else, just the contents of that field. Here is an example that stores and outputs a BLOB stored in MySQL: http://www.anyexample.com/programming/php/php_mysql_example__image_gallery_(blob_storage).xml
-
One of these (.php array) things is not like the other... but why?
rythemton replied to Mavent's topic in PHP Coding Help
The problem is the trailing comma (,) in your arrays. The second one is not actually succeeding, but once PHP throws a T_STRING error, it will stop running, so it won't find the second 'til the first is fixed. -
Try cropping the images at the point where they will meet each other. Do it on the completed image, so the shadow is effected too.
-
I just went to the web site with two different browsers (FireFox and Chrome) and didn't see the scroll bar issue you are having.
-
CSS isn't controlling the shadows. I think the problem is in the images themselves.
-
include("header.php"); Messing With CSS Design!
rythemton replied to justlukeyou's topic in PHP Coding Help
Try putting the doctype on the same line as the include. If it is still messed up, view the source that the browser is getting. <?php include("connect.php"); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> -
Initializing before the initial 'if' statement works well if you might have a lot of nested 'if' statements. You might miss an 'else' statement somewhere, and initializing before will still have the value set. On the other hand, you may want it to not be initialized so that you know that you missed something (isset comes back false, so you know you missed something.) It also may occur that you don't bother initializing the variable in the 'else' component or before the if statement because you know you'll never use that variable, which could happen if you exit() because of a failure. It's just personal preference.
-
What are you using it for? Boolean, set it to FALSE. Numbers, I set to 0, or if 0 might be used, NULL. Strings, set it to "". Arrays, set it to an empty array or to NULL. etc... I think you get the idea.
-
As time has gone by, the rules of how to display a web page have changed and become more consistent. In the beginning each browser decided on their own how to display the HTML provided. Rather than make everyone update every web site in the internet when new rules came out (good luck on that one) they just created the DOCTYPE syntax to tell the browser what version of HTML you are using. In HTML 4 and XHTML 1, you have the choice of transitional (you can use old deprecated syntax) or strict (use of deprecated syntax is forbidden.) Also, if you declare that you are using HTML 4 or XHTML 1, it is assumed that you are using CSS 2 (though some web browsers will still accept CSS 3 features.) If no DOCTYPE is declared, I believe it defaults to HTML 4 transitional, but I'm not sure. If you are new to HTML, just skip straight to learning HTML 5 and CSS 3. It's my understanding that HTML 5 does not officially support deprecated code, so there is no transitional version, but some browsers will display deprecated code anyways. In DreamWeaver, you should be able to tell it what version of HTML to use, and it should change the DOCTYPE for you.
-
minutes = math.floor( seconds/60 ); countseconds = seconds % 60; text = "You have " + minutes + ":" + ( countseconds < 10 ? "0" : "" ) + countseconds + " remaining.
-
Seconded. I'll give this a third. I've never created a fake email field before, but like the idea. I check the domain in the email to make sure there is a valid MX record for that domain. checkdnsrr( $host, 'MX' ) Most spam bots fill in fields they don't recognize with random stuff. As for Manual Spam, a notice stating that all SPAM will be deleted without being read, or something to that effect, will have most manual spammers moving on to another site.
-
include("header.php"); Messing With CSS Design!
rythemton replied to justlukeyou's topic in PHP Coding Help
This would be my guess as well. If you have a DOCTYPE declaration, any white-space before this declaration can cause the type to be ignored, which throws some browsers into HTML 4/quirks mode. This will completely mess with your CSS. IE is notorious for finding any flaw as an excuse to mess with you! Declare XHTML, but have any flaw in your code, it will throw IE into HTML 4/quirks mode. White space before the DOCTYPE, quirks mode. Use HTML 5, quirks mode (j/k, but it seems like it sometimes!) -
It means the $query is returning FALSE rather than a query resource. Change the line to read: if( $query && mysql_num_rows($query) > 0) See if that makes a difference.
-
You can use the first-child and last-child pseudo classes. #nav ul li:first-child a { border-left: none; } #nav ul li:last-child a { border-right: none; } The last-child pseudo class is CSS 3, but first-child is CSS 2, so test it in many browsers to make sure it is doing what you want it to do.
-
For most PHP pages, once the script is done running, it should be producing a pure HTML page. PHP is just being used to dynamically generate some of the HTML content. The reason I put 'most PHP pages', is because I've used PHP to generate HTML, JavaScript, CSS, XML, JSON, and others. The output just needs to be what the client is expecting, and for most pages that is HTML.
-
Are you getting any errors in your error logs? Running a PHP file as a CRON job should work fine. It would help if we at least had code to look at.
-
If you use the variables without setting them, you will get a WARNING, but your script will run anyways. Rather than fill your log with WARNING messages, it's better practice to just set them to empties. I usually set them to empty before the initial if statement. $username = ""; $password = ""; if (isset($_POST['submit'])) { // Form has been submitted. } Now I don't have to worry about the 'else' segment. This habit for me actually came from my C++ programming days, where the scope of a variable was much more restricted - anything initialized within curly brackets was unavailable outside those brackets.