Forum Topic: php cURL

(200 views • 16 replies)

New Topic Post Reply

This topic is 1 page long.

<< < > >>
None

gumOnShoe

Reply to Post Reply & Quote

Posted at: 6/28/08 06:33 PM

gumOnShoe LIGHT LEVEL 15

Sign-Up: 05/29/04

Posts: 14,110

I'm extremely new to php, to the point that I'm just copying and pasting lines of code to see how it works. I've tried several examples that attempt to use the cURL functionality, but each time I'm told this:

"Fatal error: Call to undefined function curl_init() in C:\Program Files\EasyPHP 2.0b1\www\modon.php on line 3"

I'm using the easyphp local server that was described in PHP main. I'm assuming that the package isn't installed, but am unsure of how to install something like that with this.

I tried using xamp, but found it ugly, difficult to understand, etc. So any help would be appreciated, even if it means you know how to help me get xamp running.

FORUM MODERATOR PM Forum Abuse to: Me :: AIM: gumOnShoeNG
Improve Your Responses >:(

BBS Signature

None

different

Reply to Post Reply & Quote

Posted at: 6/28/08 06:35 PM

different DARK LEVEL 35

Sign-Up: 07/08/04

Posts: 3,763

It'd probably be best to post the code you're working on so we can see what triggers the error.

we play iPhone, daily game reviews, twitter.


None

gumOnShoe

Reply to Post Reply & Quote

Posted at: 6/28/08 06:39 PM

gumOnShoe LIGHT LEVEL 15

Sign-Up: 05/29/04

Posts: 14,110

At 6/28/08 06:35 PM, different wrote: It'd probably be best to post the code you're working on so we can see what triggers the error.
<?php

$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL,'http://example.com');
curl_exec($curl_handle);
curl_close($curl_handle);

?>

Also the code from here failed: http://www.newgrounds.com/bbs/topic/5018 32

FORUM MODERATOR PM Forum Abuse to: Me :: AIM: gumOnShoeNG
Improve Your Responses >:(

BBS Signature

None

different

Reply to Post Reply & Quote

Posted at: 6/28/08 06:48 PM

different DARK LEVEL 35

Sign-Up: 07/08/04

Posts: 3,763

Your code works fine on my machine. Check to see if your PHP version is up to date with this code:

<?php
phpinfo();
?>

You're looking for a version number greater than 4.0.2.

we play iPhone, daily game reviews, twitter.


None

gumOnShoe

Reply to Post Reply & Quote

Posted at: 6/28/08 06:51 PM

gumOnShoe LIGHT LEVEL 15

Sign-Up: 05/29/04

Posts: 14,110

At 6/28/08 06:48 PM, different wrote: Your code works fine on my machine. Check to see if your PHP version is up to date with this code:

<?php
phpinfo();
?>

You're looking for a version number greater than 4.0.2.

Just a second while I run this... I already checked the local host and said it was ver 5 something, but I'll double check.

FORUM MODERATOR PM Forum Abuse to: Me :: AIM: gumOnShoeNG
Improve Your Responses >:(

BBS Signature

None

gumOnShoe

Reply to Post Reply & Quote

Posted at: 6/28/08 06:52 PM

gumOnShoe LIGHT LEVEL 15

Sign-Up: 05/29/04

Posts: 14,110

At 6/28/08 06:51 PM, gumOnShoe wrote:
At 6/28/08 06:48 PM, different wrote: Your code works fine on my machine. Check to see if your PHP version is up to date with this code:

<?php
phpinfo();
?>

You're looking for a version number greater than 4.0.2.
Just a second while I run this... I already checked the local host and said it was ver 5 something, but I'll double check.

Update:

PHP Version 5.2.0

System Windows NT KIRKLAND 5.1 build 2600
Build Date Nov 2 2006 11:50:55
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared"
Server API Apache 2.0 Handler
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\Program Files\EasyPHP 2.0b1\apache\php.ini
PHP API 20041225
PHP Extension 20060613
Zend Extension 220060519
Debug Build no
Thread Safety enabled
Zend Memory Manager enabled
IPv6 Support enabled
Registered PHP Streams php, file, data, http, ftp, compress.zlib
Registered Stream Socket Transports tcp, udp
Registered Stream Filters convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, zlib.*

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies

FORUM MODERATOR PM Forum Abuse to: Me :: AIM: gumOnShoeNG
Improve Your Responses >:(

BBS Signature

None

different

Reply to Post Reply & Quote

Posted at: 6/28/08 06:58 PM

different DARK LEVEL 35

Sign-Up: 07/08/04

Posts: 3,763

It might be an idea just to check if your EasyPHP installation isn't corrupted. Here's a setup guide.

http://www.trap17.com/forums/setting-up-
easyphp-local-computer-t65.html

The problem might also be that you're double clicking the file locally, rather than running it from an address. Go to http://localhost/modon.php (at a guess, I'm not sure of the exact URL) and see if it works then.

we play iPhone, daily game reviews, twitter.


None

BoneIdol

Reply to Post Reply & Quote

Posted at: 6/28/08 07:04 PM

BoneIdol NEUTRAL LEVEL 05

Sign-Up: 08/14/06

Posts: 819

At 6/28/08 06:33 PM, gumOnShoe wrote: "Fatal error: Call to undefined function curl_init() in C:\Program Files\EasyPHP 2.0b1\www\modon.php on line 3"

curl_init is not defined. Therefor the curl package is not installed.

http://uk3.php.net/manual/en/curl.setup.
php

Sufficiently advanced incompetence is indistinguishable from malice.


None

gumOnShoe

Reply to Post Reply & Quote

Posted at: 6/28/08 07:06 PM

gumOnShoe LIGHT LEVEL 15

Sign-Up: 05/29/04

Posts: 14,110

At 6/28/08 06:58 PM, different wrote: It might be an idea just to check if your EasyPHP installation isn't corrupted. Here's a setup guide.

http://www.trap17.com/forums/setting-up-
easyphp-local-computer-t65.html

The problem might also be that you're double clicking the file locally, rather than running it from an address. Go to http://localhost/modon.php (at a guess, I'm not sure of the exact URL) and see if it works then.

I found a menu hidden deep inside easyphp thanks to your help called php extenstions. They were all unchecked for whatever reason. Its working now, thank you fo the help.

FORUM MODERATOR PM Forum Abuse to: Me :: AIM: gumOnShoeNG
Improve Your Responses >:(

BBS Signature

None

gumOnShoe

Reply to Post Reply & Quote

Posted at: 6/28/08 10:16 PM

gumOnShoe LIGHT LEVEL 15

Sign-Up: 05/29/04

Posts: 14,110

Alright, I'm attempting to gather information that can only be acquired when I'm logged in. The cURL session doesn't recognize me being logged in, even if I am in the browser. How might I log in to my newgrounds account using php or javascript so that I can access the data I want to.

I've looked at the source code for logging in.

These are the variables which store username and passwords on newgrounds according its source code. Form variables:

lb_username
lb_userpass

And logging in is done by javascript:AttemptLogin();

Any ideas?

FORUM MODERATOR PM Forum Abuse to: Me :: AIM: gumOnShoeNG
Improve Your Responses >:(

BBS Signature

None

notsquid

Reply to Post Reply & Quote

Posted at: 6/28/08 10:18 PM

notsquid NEUTRAL LEVEL 02

Sign-Up: 06/24/08

Posts: 70

At 6/28/08 10:16 PM, gumOnShoe wrote: Any ideas?

You can't.


None

gumOnShoe

Reply to Post Reply & Quote

Posted at: 6/28/08 10:39 PM

gumOnShoe LIGHT LEVEL 15

Sign-Up: 05/29/04

Posts: 14,110

At 6/28/08 10:18 PM, notsquid wrote:
At 6/28/08 10:16 PM, gumOnShoe wrote: Any ideas?
You can't.

So, is there anyway to log in and work with fields for newgrounds? There has to be some way.

FORUM MODERATOR PM Forum Abuse to: Me :: AIM: gumOnShoeNG
Improve Your Responses >:(

BBS Signature

None

notsquid

Reply to Post Reply & Quote

Posted at: 6/29/08 07:33 AM

notsquid NEUTRAL LEVEL 02

Sign-Up: 06/24/08

Posts: 70

At 6/28/08 10:39 PM, gumOnShoe wrote: So, is there anyway to log in and work with fields for newgrounds? There has to be some way.

I spent ages trying to find a way, the only theory on how to do it i came up with was to run a browser from a VPS and some how manipulate that. but yeah, NG is made so you can't...


None

elbekko

Reply to Post Reply & Quote

Posted at: 6/29/08 07:36 AM

elbekko EVIL LEVEL 16

Sign-Up: 07/23/04

Posts: 6,587

It's not exactly hard to send the cookie headers that NG uses to log you in.

"My software never has bugs. It just develops random features. " - Unknown

[ FluxBB developer | Quickmarks 0.5.1 | Strings & Ints - my blog ]

BBS Signature

None

Dqws22

Reply to Post Reply & Quote

Posted at: 6/29/08 07:42 AM

Dqws22 DARK LEVEL 03

Sign-Up: 06/26/08

Posts: 35

Why do you even start with curl?

[Php:Main | Runescape]
Be cool, **** the school.
be the best, **** the rest.


None

gumOnShoe

Reply to Post Reply & Quote

Posted at: 6/29/08 12:07 PM

gumOnShoe LIGHT LEVEL 15

Sign-Up: 05/29/04

Posts: 14,110

At 6/29/08 07:36 AM, elbekko wrote: It's not exactly hard to send the cookie headers that NG uses to log you in.

Well, how would I do that, please elaborate. I've seen a bunch of code that looks like it does that, but I don't know how to apply it to newgrounds. This is probably the most sophisticated thing I want my web app to do, so if I can get this down I'll be fine

FORUM MODERATOR PM Forum Abuse to: Me :: AIM: gumOnShoeNG
Improve Your Responses >:(

BBS Signature

None

gumOnShoe

Reply to Post Reply & Quote

Posted at: 6/29/08 03:27 PM

gumOnShoe LIGHT LEVEL 15

Sign-Up: 05/29/04

Posts: 14,110

Well, I've figured out how to do it, it took some snooping into my temporary internet files, turning on the cookie jar, etc, but its done.

I'd post the results, but the more I think about it, its probably not a good idea to have log in scripts for newgrounds hanging around the site, that would only lead to abuse...

Thank for the help, topic locked.

FORUM MODERATOR PM Forum Abuse to: Me :: AIM: gumOnShoeNG
Improve Your Responses >:(

BBS Signature

All times are Eastern Standard Time (GMT -5) | Current Time: 11:42 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!