Twitch Posted January 28, 2009 Share Posted January 28, 2009 This one should be a layup for anyone who isn't a PHP novice like myself. I can successfully echo the following: echo '<br>'; echo '<br>'; echo '<table align="center" width="400" border="0">'; echo '<tr>'; echo '<td>There was an error uploading the file, please try again!</td>'; echo '</tr>'; echo '</table>'; However, I get a little confused on trying to echo this statement: echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; Because of the various quotes and apostrophes. Any help would be greatly appreciated. Thanks in advance, Twitch Quote Link to comment https://forums.phpfreaks.com/topic/142794-easy-one-for-a-guru/ Share on other sites More sharing options...
gevans Posted January 28, 2009 Share Posted January 28, 2009 I'm guessing that that echo doesn't work?? echo "The file ".basename($_FILES['uploadedfile']['name'])." has been uploaded"; It should work fine as long as you have a file that you're trying to/have uploaded and its called 'uploadedfile' in the form Quote Link to comment https://forums.phpfreaks.com/topic/142794-easy-one-for-a-guru/#findComment-748460 Share on other sites More sharing options...
Twitch Posted January 28, 2009 Author Share Posted January 28, 2009 I'm guessing that that echo doesn't work?? echo "The file ".basename($_FILES['uploadedfile']['name'])." has been uploaded"; It should work fine as long as you have a file that you're trying to/have uploaded and its called 'uploadedfile' in the form Whoops sorry, my coffee hasn't kicked in yet...ha ha. That statement echos just fine, I meant I'm having trouble echo'ing it in a table like the error statement. Sorry about the confusion. Quote Link to comment https://forums.phpfreaks.com/topic/142794-easy-one-for-a-guru/#findComment-748469 Share on other sites More sharing options...
gevans Posted January 28, 2009 Share Posted January 28, 2009 lol, ok... I guess you mean like this; <?php echo '<br>'; echo '<br>'; echo '<table align="center" width="400" border="0">'; echo '<tr>'; echo '<td>The file '. basename( $_FILES['uploadedfile']['name']).' has been uploaded</td>'; echo '</tr>'; echo '</table>'; Quote Link to comment https://forums.phpfreaks.com/topic/142794-easy-one-for-a-guru/#findComment-748473 Share on other sites More sharing options...
Twitch Posted January 28, 2009 Author Share Posted January 28, 2009 Thank you, thank you, thank you gevans. I've only posted a couple of questions on this forum since joining, but each time everyone has been cool and quick to answer. Didn't realize I didn't need the quotes anymore on "The file" and "has been uploaded." text. Since I'm a novice to PHP can't offer you help there, but if you have a Mac question on all over that...ha ha Much gratitude, Twitch Quote Link to comment https://forums.phpfreaks.com/topic/142794-easy-one-for-a-guru/#findComment-748478 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.