Jump to content

Easy one for a guru


Twitch

Recommended Posts

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

 

Link to comment
https://forums.phpfreaks.com/topic/142794-easy-one-for-a-guru/
Share on other sites

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.  :)

Link to comment
https://forums.phpfreaks.com/topic/142794-easy-one-for-a-guru/#findComment-748469
Share on other sites

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>';

Link to comment
https://forums.phpfreaks.com/topic/142794-easy-one-for-a-guru/#findComment-748473
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/142794-easy-one-for-a-guru/#findComment-748478
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.