Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 874555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:07:19+00:00 2026-05-15T11:07:19+00:00

as part of my time isn’t dedicated to PHP dev, I’m having an issue

  • 0

as part of my time isn’t dedicated to PHP dev, I’m having an issue which is probably easy to solve, but having absolutely no logs (PHP logs, browser firebug logs…) I’m pretty stuck.

Here’s my code; as I’m testing stuff, it’s pretty raw.
The index.php file :

<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
  // You may specify partial version numbers, such as "1" or "1.3",
  //  with the same result. Doing so will automatically load the 
  //  latest version matching that partial revision pattern 
  //  (e.g. 1.3 would load 1.3.2 today and 1 would load 1.4.2).
  google.load("jquery", "1.4.2");
 
  google.setOnLoadCallback(function() {
    // Place init code here instead of $(document).ready()
    $("#shrelock").submit(function(){
        var url = $(this).attr('action');
        $.ajax({
          url: url,
          success: function(data) {
            alert(data);
          }
        });
        return false;
    });
  });
</script>

    <form id="shrelock" action='stats.php' method='get'>
        <input type="text" name="url"/>
    </form>

Now the stats.php file :

include("bitly.php");
if ( isset($_POST["url"])   ){
    $urlToCheck = $_POST["url"];
    $bitly = new bitly('myLogin', 'myKey'); 
    print $bitly->shorten($urlToCheck);

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:07:20+00:00Added an answer on May 15, 2026 at 11:07 am

    I’m not sure what your question is, but I do see a few problems with your code.

    The ajax request you perform uses GET while the serverside code seems to expect a POST
    and also you forgot to send the ‘url’ parameter in the ajax call.

    $.ajax({
         url: url,
         type: 'POST',
         data: 'url=' + $('#shrelock input[name="url"]').val(),
         success: function(data) {
           alert(data);
         }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I see people use window.onload all the time, but why? Isn't the window part
I need to diff two log files but ignore the time stamp part of
I am a part time developer (full time student) and the company I am
The shop that I am working part time with is new to Microsoft CRM.
SELECT GETDATE() Returns: 2008-09-22 15:24:13.790 I want that date part without the time part:
In Java, given a timestamp, how to reset the time part alone to 00:00:00
I work for a local school district part time. They run a piece of
How do I select all rows for a table, their isn't part of any
Good day everyone. This problem was part of another one which it as been
Part of my everyday work is maintaining and extending legacy VB6 applications. A common

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.