Activity Stream
48,167 MEMBERS
6891 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1.     
    #1
    Member
    Website's:
    ezearn.info adfly.me

    Default need help regarding little php code error, any php expert here?

    PHP Code: 
    <div align="center">
    Enter your long URL here:<br/>
    <form action="adf.php" method="post">
    <input type="text" value="http://" name="turl" id="turl">
    <input type="submit" name="submit" value="MakeShort!">
    </form>
    </div>
    <?php
    if(isset($_POST['submit']))
    {
    function 
    makeShort()
    {
    $turl=urlencode($_POST["turl"]);
    $uid="ADF.LY UID";
    $key="ADF.LY KEY";
    $advert_type="int";
    $url="http://api.adf*****api.php?key=".$key."&uid=".$uid."&advert_type=".$advert_type."&url=".$turl."";

    $ch curl_init();
    curl_setopt($chCURLOPT_RETURNTRANSFER1);
    curl_setopt($chCURLOPT_TIMEOUT1); 
    curl_setopt($chCURLOPT_CONNECTTIMEOUT1); 
    curl_setopt($chCURLOPT_HTTP_VERSIONCURL_HTTP_VERSION_1_0);
    curl_setopt($chCURLOPT_URL$url);
    $content curl_exec($ch);
    curl_close($ch);
    return 
    $content;
    }
    ?>
    <?php
    echo"<div align='center'>Thank you for using this service</div><br/>";
    $surl makeShort();
    echo
    "<div align='center'>Your short URL is:<br/>";
    echo
    "<strong><a href='$surl'>$surl</a></strong>";
    ?>
    when i try to use this on hosting, this error message comes up. how can i solve this issue?
    "Parse error: syntax error, unexpected $end in /home/a657xxxx/public_html/index.php on line 35"
    SpiderZq Reviewed by SpiderZq on . need help regarding little php code error, any php expert here? <div align="center"> Enter your long URL here:<br/> <form action="adf.php" method="post"> <input type="text" value="http://" name="turl" id="turl"> <input type="submit" name="submit" value="MakeShort!"> </form> </div> <?php if(isset($_POST)) { Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    warezwaldo.com
    PHP Code: 
     <div align="center">
    Enter your long URL here:<br/>
    <form action="adf.php" method="post">
    <input type="text" value="http://" name="turl" id="turl">
    <input type="submit" name="submit" value="MakeShort!">
    </form>
    </div>
    <?php
    if(isset($_POST['submit']))
    {
    function 
    makeShort()
    {
    $turl=urlencode($_POST["turl"]);
    $uid="ADF.LY UID";
    $key="ADF.LY KEY";
    $advert_type="int";
    $url="http://api.adf*****api.php?key=".$key."&uid=".$uid."&advert_type=".$advert_type."&url=".$turl."";

    $ch curl_init();
    curl_setopt($chCURLOPT_RETURNTRANSFER1);
    curl_setopt($chCURLOPT_TIMEOUT1); 
    curl_setopt($chCURLOPT_CONNECTTIMEOUT1); 
    curl_setopt($chCURLOPT_HTTP_VERSIONCURL_HTTP_VERSION_1_0);
    curl_setopt($chCURLOPT_URL$url);
    $content curl_exec($ch);
    curl_close($ch);
    return 
    $content;
    }

    echo
    "<div align='center'>Thank you for using this service</div><br/>";
    $surl makeShort();
    echo
    "<div align='center'>Your short URL is:<br/>";
    echo
    "<strong><a href='$surl'>$surl</a></strong>";
    ?>

    Try That.

  4.     
    #3
    Member
    Website's:
    ezearn.info adfly.me
    @itz.animal: error msg changed to
    Parse error: syntax error, unexpected $end in /home/a6575072/public_html/index.php on line 34


  5.     
    #4
    Member
    PHP Code: 
    <div align="center">
    Enter your long URL here:<br/>
    <form action="adf.php" method="post">
    <input type="text" value="http://" name="turl" id="turl">
    <input type="submit" name="submit" value="MakeShort!">
    </form>
    </div>
    <?php
    if(isset($_POST['submit']))
    {
        function 
    makeShort()
        {
            
    $turl urlencode($_POST["turl"]);
            
    $uid  "ADF.LY UID";
            
    $key  "ADF.LY KEY";
            
    $advert_type "int";
            
    $url "http://api.adf*****api.php?key=".$key."&uid=".$uid."&advert_type=".$advert_type."&url=".$turl."";

            
    $ch curl_init();
            
    curl_setopt($chCURLOPT_RETURNTRANSFER1);
            
    curl_setopt($chCURLOPT_TIMEOUT1); 
            
    curl_setopt($chCURLOPT_CONNECTTIMEOUT1); 
            
    curl_setopt($chCURLOPT_HTTP_VERSIONCURL_HTTP_VERSION_1_0);
            
    curl_setopt($chCURLOPT_URL$url);
            
    $content curl_exec($ch);
            
    curl_close($ch);
            return 
    $content;
        }

        echo 
    "<div align='center'>Thank you for using this service</div><br/>";
        
    $surl makeShort();
        echo 
    "<div align='center'>Your short URL is:<br/>";
        echo 
    "<strong><a href='$surl'>$surl</a></strong>";
    }
    ?>
    You really need to re-think that code, could be much better.

  6.     
    #5
    Moderator
    NewEraCracker's Avatar
    lol el_j was faster.
    And I agree with him.
    Trusted: Dom, l0calh0st, 0ccul7, robert420
    Find all threads started by NewEraCracker

  7.     
    #6
    Member
    Website's:
    ezearn.info adfly.me
    Fatal error: Call to undefined function makeshort() in /home/a6575072/public_html/index.php on line 33

  8.     
    #7
    Member
    Edited my post, you shouldn't get the "undefined function" error now. But I still say you should reconsider your code structure, you can improve that code.

  9.     
    #8
    Member
    Website's:
    ezearn.info adfly.me
    see this on:
    http://adf.netai.net/

  10.     
    #9
    Member
    Website's:
    ezearn.info adfly.me
    Quote Originally Posted by SpiderZq View Post
    when i try to makeshort its redirected on "http://removed/?"

  11.     
    #10
    Member
    Most likely because of action="adf.php".

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. bought asfile.com premium in error, who wants my code?
    By takkofs in forum File Host Discussion
    Replies: 0
    Last Post: 22nd Oct 2012, 05:51 PM
  2. [Hiring] vBulletin Expert And vBulletin Custom Coding Expert.
    By BlueError in forum Completed Transactions
    Replies: 6
    Last Post: 13th Apr 2012, 04:53 PM
  3. Replies: 1
    Last Post: 3rd Apr 2012, 09:50 AM
  4. [For Hire] Some expert who can fix crawl error (Offering $10)
    By sSKKa in forum Completed Transactions
    Replies: 7
    Last Post: 3rd Jan 2012, 03:32 PM
  5. Replies: 1
    Last Post: 27th Aug 2011, 01:45 PM

Tags for this Thread

BE SOCIAL