Hi,
as part of my time is'nt dediacted to PHP dev, I'm having an issue wich 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);
}