The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 25, 2012, 08:35:32 AM

Login with username, password and session length


Pages: 1 ... 3 4 [5]
  Print  
Author Topic: Perk's NEW WebRequest Class  (Read 12127 times)
windtalker
n00b
*
Offline Offline

Posts: 8


View Profile
« Reply #60 on: October 30, 2009, 11:53:37 PM »

I was testing out Perk's WebRequest 2.1
If you are running PHP 5.3.0 you may have similar Deprecated errors:

Quote
Deprecated: Call-time pass-by-reference has been deprecated in C:\Program Files\PHP5.3.0\www\phfiles\class.webrequest2.php on line 461

Deprecated: Call-time pass-by-reference has been deprecated in C:\Program Files\PHP5.3.0\www\phpfiles\class.webrequest2.php on line 534

Deprecated: Call-time pass-by-reference has been deprecated in C:\Program Files\PHP5.3.0\www\phpfiles\class.webrequest2.php on line 534

Deprecated: Call-time pass-by-reference has been deprecated in C:\Program Files\PHP5.3.0\www\phpfiles\class.webrequest2.php on line 534

Notice: Undefined variable: thisBuffLen in C:\Program Files\PHP5.3.0\www\phpfiles\class.webrequest2.php on line 278

You will have to go to your php.ini and change "allow_call_time_pass_reference = Off" to "allow_call_time_pass_reference = On"
« Last Edit: October 31, 2009, 12:05:17 AM by windtalker » Logged

No links in signatures please
windtalker
n00b
*
Offline Offline

Posts: 8


View Profile
« Reply #61 on: October 31, 2009, 01:24:44 AM »

Perkiset, can you help me out with a problem? I am trying to visit a page with HTTPS using the below code:

I needed to uncomment OpenSSL extension in php.ini , lol
« Last Edit: November 01, 2009, 12:10:28 AM by windtalker » Logged

No links in signatures please
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 9896



View Profile
« Reply #62 on: November 02, 2009, 10:18:45 AM »

 ROFLMAO glad you got it sorted WT.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
patch
Rookie
**
Offline Offline

Posts: 32


View Profile
« Reply #63 on: August 04, 2011, 10:49:36 AM »

Trying to use the class to post some data with the following code:

Code:
include('webclass.php');

$req = new webRequest2();
$content = $req->simpleGet('http://www.racingpost.com/');

$req = new webRequest2();
$req->debugMode = WRD_ECHO;


$req = new webRequest2();
$req->domain = 'https://reg.racingpost.com';
$req->url = '/modal_dialog/login.sd?protoSecure=0';
$req->debugMode = WRD_LOG;
$req->debugLogFile = 'gettest.txt';
$req->debugLogClearOnDispatch = true;
$req->addPostParam('in_un', 'wellyfish');
$req->addPostParam('in_pw', 'wellyfish99');
$req->addPostParam('process', 'IN');
$req->addPostParam('logInType', 'lightbox');
$req->addPostParam('PARGS', '');
$req->addPostParam('protoSecure', '0');

$req->method='POST';
$req->dispatch();
echo $req->getRawResponse();

getting the following errors:

Notice: Undefined index: content-length in C:\Server\RP\webclass.php on line 468

Notice: Undefined index: transfer-encoding in C:\Server\RP\webclass.php on line 476

anyone tell me why they are throwing?
Cheers
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 9896



View Profile
« Reply #64 on: August 04, 2011, 06:05:57 PM »

Those are just notices, not errors.

If you write code that looks like this:

<?php

error_reporting
(E_ALL);
if (
$myArr['testing'] == 'What, me worry?'
	
echo 
"This will never print...\n";

?>

you'd get a message like
Notice: Undefined index: testing in (thefile)

because I'm asking about an index that hasn't been defined in the array yet. To be totally proper you can use isset() to make sure before you reference:

<?php

if (isset($myArr['testing']))
	
if (
$myArr['testing'] == 'This is a test')
	
	
echo 
'This will never echo';

?>

But this is all rather academic because PHP can honestly GAF if you have predefined a variable or index. In this case, I must be inquiring about content-length and transfer-encoding before I've defined them. You should have your error_reporting set at E_WARNING or E_ERROR rather than E_ALL or E_NOTICE because you'll get all kinds of output that is ostensibly meaningless.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
patch
Rookie
**
Offline Offline

Posts: 32


View Profile
« Reply #65 on: August 05, 2011, 03:32:28 AM »

Oops ...

note to self - Don't consume alcohol when trying to code and then annoy decent folk by asking stupid questions!

Thanks...
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 9896



View Profile
« Reply #66 on: August 05, 2011, 10:49:17 AM »

 ROFLMAO no worries patch.

I've never EVER done such a thing.


Smiley








 ROFLMAO



Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
Pages: 1 ... 3 4 [5]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!