Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22
  1. #11
    Join Date
    Oct 2005
    Location
    Spain, Valencia
    Posts
    20,492
    Tokens
    3,575
    Habbo
    GoldenMerc

    Latest Awards:

    Default

    same error
    Parse error: syntax error, unexpected T_VARIABLE in /home/hhgsnet/public_html/radiodjpanel/ibanner.php on line 20

  2. #12
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    Post the whole code again, rather than moaning ^_^


    www.fragme.co = a project.

  3. #13
    Join Date
    Oct 2005
    Location
    Spain, Valencia
    Posts
    20,492
    Tokens
    3,575
    Habbo
    GoldenMerc

    Latest Awards:

    Default

    PHP Code:
    <?php require('head.php');

    if(!
    $_GET["upload"])
    {
    echo(
    '

    <form action="?upload=upload" method="post" enctype="multipart/form-data">
    <div align="center">
    Please Choose a file to upload...<br />
    <input type="file" name="file" /><br /><br />
    <input type="submit" value="Upload File" />
    </div>
    </form>

    '
    );
    }
    else
    {
    $name=$_FILES["file"]["name"]   
     
    $filename 'uploads/{$name}';  
        if(
    $name == "banner1.jpg" || $name =="banner2.jpg")
        {
        
    move_uploaded_file($_FILES["file"]["tmp_name"],$filename);

    $filesize getimagesize("$filename");

    if(
    $filesize[0]<=53 AND $filesize[1]<=53)
    {
        echo(
    'Your File URL<br /><input type="text" size="50" value="http://www.hhgs.net/valuesbanners/'.$filename.'" />');
    }
    else
    {
    unlink("$filename");
    echo(
    'Files must be the dimensions 800*900 or less!');
    }
    }
    else
    {
    echo 
    "File name not allowed";
    }

  4. #14
    Join Date
    Jun 2008
    Location
    Manchester
    Posts
    766
    Tokens
    0

    Default

    I uploaded it myself and got a different error, but got it to work by doing this:
    PHP Code:
    <?php require('head.php');

    if(!
    $_GET["upload"])
    {
    echo(
    '

    <form action="?upload=upload" method="post" enctype="multipart/form-data">
    <div align="center">
    Please Choose a file to upload...<br />
    <input type="file" name="file" /><br /><br />
    <input type="submit" value="Upload File" />
    </div>
    </form>

    '
    );
    }
    else
    {
    $name=$_FILES["file"]["name"];
    $filename 'uploads/'.$name.'';
        if(
    $name == "banner1.jpg" || $name =="banner2.jpg")
        {
        
    move_uploaded_file($_FILES["file"]["tmp_name"],$filename);

    $filesize getimagesize("$filename");

    if(
    $filesize[0]<=53 AND $filesize[1]<=53)
    {
        echo(
    'Your File URL<br /><input type="text" size="50" value="http://www.hhgs.net/radiodjpanel/'.$filename.'" />');
    }
    else
    {
    unlink("$filename");
    echo(
    'Files must be the dimensions 53*453 or less!');
    }
    }
    else
    {
    echo 
    "File name not allowed";

    }
    I forgot the final '}'.
    See if it works now.
    Works for me: http://johnphptest.freehostia.com/upload.php

  5. #15
    Join Date
    Oct 2005
    Location
    Spain, Valencia
    Posts
    20,492
    Tokens
    3,575
    Habbo
    GoldenMerc

    Latest Awards:

    Default

    Thanks il +rep everyone whos helped me, Im going to edit it now so i may pop back and post again

  6. #16
    Join Date
    Oct 2005
    Location
    Spain, Valencia
    Posts
    20,492
    Tokens
    3,575
    Habbo
    GoldenMerc

    Latest Awards:

    Default

    This is the new code, But its not working now its giving this error:
    Parse error: syntax error, unexpected T_STRING in /home/hhgsnet/public_html/radiodjpanel/ibanner.php on line 11
    Heres the code +rep to someone who can fix it
    PHP Code:
    <?php require('head.php');

    if(!
    $_GET["upload"])
    {
    echo(
    '

    <form action="?upload=upload" method="post" enctype="multipart/form-data">
    <div align="center">
    Please Choose a file to upload...<br />
    The banner displaying here is: <br />
    <center><img src='
    http://hhgs.net/valuesbanners/MemmishCasiBannerPreTrans2712917281.gif' width='312' height='50'>
    </center>
    <
    br />
    <
    input type="file" name="file" /><br /><br />
    <
    input type="submit" value="Upload File" />
    </
    div>
    </
    form>

    ');
    }
    else
    {
    $name=$_FILES["file"]["name"];
    $filename = '
    uploads/'.$name.'';
        if($name == "banner1.jpg" || $name =="banner2.jpg")
        {
        move_uploaded_file($_FILES["file"]["tmp_name"],$filename);

    $filesize = getimagesize("$filename");

    if($filesize[0]<=53 AND $filesize[1]<=53)
    {
        echo('
    Your File URL<br /><input type="text" size="50" value="http://www.hhgs.net/valuesbanners/'.$filename.'" />');
    }
    else
    {
    unlink("$filename");
    echo('
    Files must be the dimensions 800*900 or less!');
    }
    }
    else
    {
    echo "File name not allowed";

    }

  7. #17
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    7,554
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by HHGS.Net View Post
    This is the new code, But its not working now its giving this error:

    Heres the code +rep to someone who can fix it
    PHP Code:
    <?php require('head.php');

    if(!
    $_GET["upload"])
    {
    echo(
    '

    <form action="?upload=upload" method="post" enctype="multipart/form-data">
    <div align="center">
    Please Choose a file to upload...<br />
    The banner displaying here is: <br />
    <center><img src='
    http://hhgs.net/valuesbanners/MemmishCasiBannerPreTrans2712917281.gif' width='312' height='50'>
    </center>
    <
    br />
    <
    input type="file" name="file" /><br /><br />
    <
    input type="submit" value="Upload File" />
    </
    div>
    </
    form>

    ');
    }
    else
    {
    $name=$_FILES["file"]["name"];
    $filename = '
    uploads/'.$name.'';
        if($name == "banner1.jpg" || $name =="banner2.jpg")
        {
        move_uploaded_file($_FILES["file"]["tmp_name"],$filename);

    $filesize = getimagesize("$filename");

    if($filesize[0]<=53 AND $filesize[1]<=53)
    {
        echo('
    Your File URL<br /><input type="text" size="50" value="http://www.hhgs.net/valuesbanners/'.$filename.'" />');
    }
    else
    {
    unlink("$filename");
    echo('
    Files must be the dimensions 800*900 or less!');
    }
    }
    else
    {
    echo "File name not allowed";

    }
    you can't use ' on line 11 because it is ending the echo

  8. #18
    Join Date
    Jun 2008
    Location
    United Kingdom
    Posts
    2,015
    Tokens
    568

    Latest Awards:

    Default

    PHP Code:
    <?php require('head.php');

    if(!
    $_GET["upload"])
    {
    echo(
    '

    <form action="?upload=upload" method="post" enctype="multipart/form-data">
    <div align="center">
    Please Choose a file to upload...<br />
    The banner displaying here is: <br />
    <center><img src=\'http://hhgs.net/valuesbanners/MemmishCasiBannerPreTrans2712917281.gif\' width=\'312\' height=\'50\'>
    </center>
    <br />
    <input type="file" name="file" /><br /><br />
    <input type="submit" value="Upload File" />
    </div>
    </form>

    '
    );
    }
    else
    {
    $name=$_FILES["file"]["name"];
    $filename 'uploads/'.$name.'';
        if(
    $name == "banner1.jpg" || $name =="banner2.jpg")
        {
        
    move_uploaded_file($_FILES["file"]["tmp_name"],$filename);

    $filesize getimagesize("$filename");

    if(
    $filesize[0]<=53 AND $filesize[1]<=53)
    {
        echo(
    'Your File URL<br /><input type="text" size="50" value="http://www.hhgs.net/valuesbanners/'.$filename.'" />');
    }
    else
    {
    unlink("$filename");
    echo(
    'Files must be the dimensions 800*900 or less!');
    }
    }
    else
    {
    echo 
    "File name not allowed";

    }

  9. #19
    Join Date
    Oct 2005
    Location
    Spain, Valencia
    Posts
    20,492
    Tokens
    3,575
    Habbo
    GoldenMerc

    Latest Awards:

    Default

    Now this has gone wrong too with this error:
    Parse error: syntax error, unexpected T_STRING in /home/hhgsnet/public_html/radiodjpanel/ibanner.php on line 13
    Heres the new code:
    PHP Code:
    <?php require('head.php');

    if(!
    $_GET["upload"])
    {
    echo(
    '

    <form action="?upload=upload" method="post" enctype="multipart/form-data">
    <div align="center">
    Please Choose a file to upload...<br />
    The banner displaying here is: <br />
    <center><img src=\'http://hhgs.net/valuesbanners/banner1.gif\' width=\'312\' height=\'50\'>
    </center>
    To update the banner make sure the file name is <b> '
    banner1.gif'</b> <br />
    <br />
    <input type="file" name="file" /><br /><br />
    <input type="submit" value="Upload File" />
    </div>
    </form>

    '
    );
    }
    else
    {
    $name=$_FILES["file"]["name"];
    $filename 'uploads/'.$name.'';
        if(
    $name == "banner1.jpg")
        {
        
    move_uploaded_file($_FILES["file"]["tmp_name"],$filename);

    $filesize getimagesize("$filename");

    if(
    $filesize[0]<=53 AND $filesize[1]<=53)
    {
        echo(
    'Your File URL<br /><input type="text" size="50" value="http://www.hhgs.net/valuesbanners/'.$filename.'" />');
    }
    else
    {
    unlink("$filename");
    echo(
    'Files must be the dimensions 800*900 or less!');
    }
    }
    else
    {
    echo 
    "File name not allowed";

    }

  10. #20
    Join Date
    Jun 2008
    Location
    United Kingdom
    Posts
    2,015
    Tokens
    568

    Latest Awards:

    Default

    PHP Code:
    <?php require('head.php');

    if(!
    $_GET["upload"])
    {
    echo(
    '

    <form action="?upload=upload" method="post" enctype="multipart/form-data">
    <div align="center">
    Please Choose a file to upload...<br />
    The banner displaying here is: <br />
    <center><img src=\'http://hhgs.net/valuesbanners/banner1.gif\' width=\'312\' height=\'50\'>
    </center>
    To update the banner make sure the file name is <b> \'banner1.gif\'</b> <br />
    <br />
    <input type="file" name="file" /><br /><br />
    <input type="submit" value="Upload File" />
    </div>
    </form>

    '
    );
    }
    else
    {
    $name=$_FILES["file"]["name"];
    $filename 'uploads/'.$name.'';
        if(
    $name == "banner1.jpg")
        {
        
    move_uploaded_file($_FILES["file"]["tmp_name"],$filename);

    $filesize getimagesize("$filename");

    if(
    $filesize[0]<=53 AND $filesize[1]<=53)
    {
        echo(
    'Your File URL<br /><input type="text" size="50" value="http://www.hhgs.net/valuesbanners/'.$filename.'" />');
    }
    else
    {
    unlink("$filename");
    echo(
    'Files must be the dimensions 800*900 or less!');
    }
    }
    else
    {
    echo 
    "File name not allowed";

    }

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •