![]() |
![]() ![]() |
![]() |
Gerry Roston |
![]() ![]()
Post
#1
|
Group: Members Posts: 3 Joined: 4-May 22 Member No.: 28,338 ![]() |
I am beyond confused. Here is a some of my html code (which I copied using my browser’s ‘show source’ capability). Very simple.
CODE <div style="width: 40%; float: right;"> <label style="position: absolute; top: 250px;">File with new logo:</label> <input style="position: absolute; top: 280px;" type="file" name="LogoFile"> </div> In my code, I have some PHP to gather the data that is inputted and store it in a database. The code works just fine. However, I added two lines to the code: CODE echo "checking filename: "; echo $_FILES['LogoFile']['name']; and the filename comes back empty, despite my having selected a file. Even weirder, the code used to work, but only stopped working once I moved the code into the <div> and added the style stuff. I suspect that I am missing something trivially easy – can you please point me to a solution. |
Christian J |
![]()
Post
#2
|
. ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: WDG Moderators Posts: 9,661 Joined: 10-August 06 Member No.: 7 ![]() |
I added two lines to the code: CODE echo "checking filename: "; echo $_FILES['LogoFile']['name']; and the filename comes back empty, despite my having selected a file. Looks correct to me. Could it be that the above lines are in the wrong place in the PHP script? QUOTE Even weirder, the code used to work, but only stopped working once I moved the code into the <div> and added the style stuff. I see no reason for that. (As a sidenote, I wouldn't use CSS absolute positioning like that, also I wouldn't use CSS as nline styles for practical reasons). |
Christian J |
![]()
Post
#3
|
. ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: WDG Moderators Posts: 9,661 Joined: 10-August 06 Member No.: 7 ![]() |
Seems the thread got closed by mistake. Opened now.
![]() |
pandy |
![]()
Post
#4
|
🌟Computer says no🌟 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: WDG Moderators Posts: 20,733 Joined: 9-August 06 Member No.: 6 ![]() |
When you moved the code, did you include the PHP tags?
|
Gerry Roston |
![]()
Post
#5
|
Group: Members Posts: 3 Joined: 4-May 22 Member No.: 28,338 ![]() |
I found my stupid mistake! I had put the new <div> code outside of the <form> tag. Once I adjusted that, everything worked fine.
|
![]() ![]() |
![]() |
Lo-Fi Version | Time is now: 28th April 2024 - 07:21 AM |