Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.