Hey Alex, thanks for the great tutorials. Why does this one work fine but the other tutorial on thenewboston's channel (tutorial 90-92) yield a "Undefined Index" error?
I realized in that tutorial you started off by assigning variables to the files array like $name = $_FILES['file']['name'] whereas in this tutorial you started off with an IF ISSET statement and THEN assigned the variables within the IF statement. Could you say why this one works and the other doesn't anymore? Please respond!
To everyone complaining about the error, just pass it through anothe variable eg. $explode=explode('.',$file_name); $file_ext=strtolower(end($explode));
Hey Alex, thanks for the great tutorials. Why does this one work fine but the other tutorial on thenewboston's channel (tutorial 90-92) yield a "Undefined Index" error?
I realized in that tutorial you started off by assigning variables to the files array like $name = $_FILES['file']['name'] whereas in this tutorial you started off with an IF ISSET statement and THEN assigned the variables within the IF statement. Could you say why this one works and the other doesn't anymore? Please respond!
PancakePlease 1 week ago in playlist File Uploading
To everyone complaining about the error, just pass it through anothe variable eg. $explode=explode('.',$file_name); $file_ext=strtolower(end($explode));
Not the most correct way, but it does the job
thimira92 3 months ago
This has been flagged as spam show
for the variable reference error ! USE BELOW !
what you need to do is call the explode than in another variable do the end
$file_ext = explode('.', $file_name);
$extension = strtolower(end($file_ext));
print_r($extension);
Hope this helps guys!
jeremylmassey 6 months ago
Comment removed
jeremylmassey 6 months ago
Comment removed
jeremylmassey 6 months ago
you don't want to read the extension because it can be masked
FlamingTorch9 7 months ago
howcome you dont get an error?
Strict Standards: Only variables should be passed by reference in C:\xampp\htdocs\fileupload\index.php on line 7
jakewestgomila 8 months ago
@jakewestgomila
i have the same problem !
have You fixed it ?
russel07crowe 6 months ago
@russel07crowe
nope :(
jakewestgomila 6 months ago
5:11 I got this:
Fatal error: Function name must be a string in C:\xampp\htdocs\index.php on line 6
anyone can help me. Thanx in advance guys !
gentlxman 8 months ago
@gentlxman you have to wrap the first parameter (the . in this case) in quotes "." for example
sith4life 3 days ago
keeps saying strict standards:
Strict Standards: Only variables should be passed by reference in C:\xampp\htdocs\CMS\admin\upload\index.php on line 7
line 7 is: $file_ext = end(explode('.',$file_name));
what did i do wrong? : / and great tutorials btw! :D
jakewestgomila 8 months ago