NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page This is a really noobish question...

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 08-09-2005, 05:01 AM THREAD STARTER               #1 (permalink)
Senior Member
 
Barrucadu's Avatar
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,689
Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold
 




This is a really noobish question...


On my image hosting site they're is a 1MB filesize limit, the script I use to check that is:
????: NamePros.com http://www.namepros.com/programming/114015-this-is-a-really-noobish-question.html

PHP Code:
//Check the size
if(!filesize($_FILES['uploadedfile']['name']) <= 1000000){
    echo 
"File too large!"
    
echo "<p>Maximum size is 1MB</p>"
    
die("")

1st question: are there 1,000,000 bytes in a megabyte
2nd question: would that work?
Barrucadu is offline  
Old 08-09-2005, 05:23 AM   #2 (permalink)
Senior Member
 
scribby's Avatar
Join Date: May 2005
Location: Australia
Posts: 1,197
scribby is a glorious beacon of lightscribby is a glorious beacon of lightscribby is a glorious beacon of lightscribby is a glorious beacon of lightscribby is a glorious beacon of lightscribby is a glorious beacon of lightscribby is a glorious beacon of lightscribby is a glorious beacon of light
 



there are 1048576 bytes in 1mb

and die("") I dont think will work use die();

PHP Code:

//Check the size
if(!filesize($_FILES['uploadedfile']['name']) <= 1048576){
    echo 
"File too large!";
    echo 
"<p>Maximum size is 1MB</p>";
    die();
????: NamePros.com http://www.namepros.com/showthread.php?t=114015

scribby is offline  
Old 08-09-2005, 10:13 AM   #3 (permalink)
NamePros Member
Join Date: Jan 2005
Location: Texas USA
Posts: 71
Outer is an unknown quantity at this point
 



You can use double quotes in the DIE() function

Wont affect anything. They are actually suppossed to be used for a message inside of the DIE() function
__________________
I wonder...
Outer is offline  
Old 08-09-2005, 11:00 AM   #4 (permalink)
DNOA Member
Join Date: May 2004
Posts: 5,040
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
 


Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Yeah, but there's no point, it's just extra typing.
mholt is offline  
Old 08-09-2005, 12:25 PM   #5 (permalink)
NamePros Regular
 
moondog's Avatar
Join Date: Jun 2004
Posts: 587
moondog is a name known to allmoondog is a name known to allmoondog is a name known to allmoondog is a name known to allmoondog is a name known to allmoondog is a name known to allmoondog is a name known to allmoondog is a name known to all
 



Originally Posted by compuXP
Yeah, but there's no point, it's just extra typing.
You can certainly use is as:
????: NamePros.com http://www.namepros.com/showthread.php?t=114015

die();

or

die("");

Quotes can be most useful to report back an error to the surfer if you want. I do this all the time when I write code for inept end-users. I will display a SPECIFIC error that I can trace back to the exact line in the code.

For example, if you are trying to open a file and it fails, you can always report the error something like this:

PHP Code:
<?
  $infile 
fopen('file.txt','r');
  if(!
$infile) {die("Error Opening File");}
?>
-Bob
__________________
Can't wait to be out of this forsaken business. Getting close! :)
moondog is offline  
Old 08-09-2005, 12:36 PM   #6 (permalink)
DNOA Member
Join Date: May 2004
Posts: 5,040
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
 


Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
well, yeah, but first an ugly error would appear - you'd want the @ character in the line.
mholt is offline  
Old 08-09-2005, 02:11 PM   #7 (permalink)
Senior Member
 
Porte's Avatar
Join Date: May 2005
Location: I'm right here
Posts: 3,526
Porte has much to be proud ofPorte has much to be proud ofPorte has much to be proud ofPorte has much to be proud ofPorte has much to be proud ofPorte has much to be proud ofPorte has much to be proud ofPorte has much to be proud ofPorte has much to be proud of
 



or

error_reporting(0);
__________________
WP Theme Developer
Your One-stop for Premium Magazine/CMS WordPress Themes
Deluxe Themes
Porte is offline  
Old 08-09-2005, 02:14 PM   #8 (permalink)
Account Closed
 
axilant's Avatar
Join Date: May 2004
Location: /etc/passwd
Posts: 2,178
axilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to behold
 

Member of the Month
July 2005

I rather use exit; :S

Also... i dont usually use those types of functions unless i cant use a if/else combo :-/ its better to me...
axilant is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Religious Question. Humdizzy The Break Room 99 06-22-2005 11:53 AM
Not at trick question Coastalguy The Break Room 5 05-04-2005 05:22 PM
Quick question... kektex Domain Newbies 1 03-31-2005 02:24 PM
little question.. khkhan Domain Appraisals 2 11-20-2004 05:28 AM
two-letter .com domain question questioning Domain Name Discussion 1 10-05-2004 05:08 PM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 08:19 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger