Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Curl Load Page That Has Variable In Url?


I'm trying to load a page that has a variable in the url. Such as:

index.php?name=bob

I tried acting like the page was just a normal page (such as index.php) but that didn't seem to work. How do I give the server the variable in the url?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Session Var Is Setting ONLY AFTER I Reload Page, Form Var Displays First Page Load
Page1 has a form that calls Page2. The beginning of Page2:
<? php session_start();
$s=$_POST['sSelected'];
session_register("s"); ?>

in the middle of Page2 I have a form varaible:
<?php echo $_POST['stateSelected']; ?>
<?php echo $_SESSION['s']; ?>

The form var displays the first time the page loads. The session var
displays only after reloading the page2.

Using PHP To Load Another Page Or Html Page
Ive got a PHP script, which if it ends correctly, i want load another
PHP file or an HTML page automatically, ie without user intervention.
The new page shoud replace the current page on the browser. Is there a
PHP command or function which does this?

Load SQL Variable & Edit Right Away...
I am making a simple test database that's hosted on my hosting account and I've got one php page that pulls out all the values from a DB table and sorts them into input fields that are sorted inside a table. Now the reason I insert those values into a input field is because I want to make another form function where those loaded values can be changed and saved right away. My code for right now is this : Code:

Page Load For IP
Is there any way only a certian IP address on our network can see a
particular Table on the page? or if a certian ip Adress goes to our intranet page load a certain page depending on that IP address.

How To Load CSV Onto PHP Page
is there a way to load CSV file into a PHP page? if ever, how and what is the code?

Incrementing On Page Load
I have one form that I want to send email. Instead of using multiple pages, I have condensed it to one. However, I don't know how to increment a value, say "display", each time the submit button is clicked.

For instance - I have $display = "1". I want 1 to increment to 2, 3, and so on once the user clicks submit once, twice, etc. But I only want the "validation fields" to show after the user has clicked submit.

Set Time To Load A Page
I want to make a page which take time almost 60 seconds to load the contents....means a script in php which sleep for a 60 seconds and then execute the next part....

Page Load Frequency
I need a function to prevent a page from being loaded too often too
fast.
So say, one is only allowed to refresh a single page 5 times in 10
seconds, or 10 times in 5 seconds (or whatever ... ).
If the load frequency exceeds that, the site calls exit(); And a
message is displayed. Just like Expression Engine does ...

This way i want to protect the DB from being queried rediculously
often, and maybe even protect it from DDOS attacks.

I hope it's clear. I don't know where to start ..

Redirect If Page Does Not Load
I have a form that will not submit if certain data cannot be found in Mysql or it will take very long to submit. Is there a way i can have the form go to an error page if it does not submit or load results in 5 seconds.

If it does take long i need the following:
$msg[] = $error10;
header("Location: quote_error.php?");

Never Ending Page Load
When I run this script, it tries to load but after aout 10 minutes the whole browser locks up because it can't do it. I have a hunch it is because the while loop doesn't ever stop, but I don't know how to prevent it. Code:

Page Load Time
I have a php/html page that is taking longer to load then i think it should is there a way to see what part of the page is hanging it up?

Load The HTML Output Of A File Into A Variable?
How can i load the html output of a file into a variable.. Kind of like include()ing or require()ing a file.. but not echoing the content.. but saving it to a variable..

Can it be done? I dont want to use fgets because they are PHP files.. and i want to get the HTML as if a user opened with a browser..

Curl GET (url) Variable
Having some difficulty in a code with a GET variable. I tried to put the variable in the url and now trying to post it as a get variable seperatly.

$cUrl = curl_init();
curl_setopt($cUrl, CURLOPT_URL, 'http://site.com/c.php');
curl_setopt($cUrl, CURLOPT_GET,1);
curl_setopt($cUrl, CURLOPT_POSTFIELDS, 'id=100494&');
curl_setopt($cUrl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($cUrl, CURLOPT_TIMEOUT, &#393;');
curl_setopt($cUrl, CURLOPT_PROXY, $buffer);
$pageContent = trim(curl_exec($cUrl));
curl_close($cUrl);
print "$pageContent";


Also using a proxy...
I changed id=100494& with id=100494 býut didnt seem to have any effect either. My output is "1"

Can´t Load Page Before Refresh??
Why my pages don´t appear after linking to them (.php3), I have to Refresh the page and then it appears. And of course I loose the passed information from previous page??? This is REALLY bothering me A LOT. Please, does anyone know the answer???

Submit Vs. A Fresh Page Load
I'm developing a page - mostly for the learning experience - that
includes a form with several text fields and a submit button. When
it's submitted, there is some server-side processing and the output is
displayed as part of the same page. (the form's action attribute is
set to: "<?php $PHP_SELF ?>").

One of the steps in the PHP script is to check for the existance of a
hidden element in the form so that I know whether the page is being
sent out as a result of a new request or from the form having been
submitted.

This all works as expected. When the page is sent out as a result of
having been requested from its "home" page, the results are not shown;
when the submit button is clicked, the page is sent out with the
results shown.

Finally my question: when viewing the page with the results shown, if
I press <F5> or click on "Refresh", it behaves as if I had clicked the
Submit button (that is, it shows the results). I would expect it to
return the page as if it was a new request (and NOT show the results).

How To Submit A Form Without New Page Load
I know that using a frame it can be done for AJAX. But
without frame is it possible to submit a form without
new page load?

Page Load Time + Iframe
There is any way to get the total load time of a page when you get an
"IFRAME" on it?
In all the tests, I got only the base page time without the "IFRAME"
time....

<?php
$bench = new phpCounter();
$bench->StartCouter();

$page = "<iframe class=......";
echo $page;

$bench->EndCounter();

echo $bench->GetCounter();
?>

Where:
// StartCounter() & EndCounter() call this function
function SetCounter ( ) // {{{
{

list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);

} // }}}

// Function to return the counter
function GetCounter ( ) // {{{
{

$output = ($this->end - $this->start);
return substr($output, 0, 5);

} // }}}

Set_error_handler: Page Does'nt Load
I've written a custom error handler and it works as it should on my development server(mac OS), but when I try to use it on the live server(freeBSD: PHP Version 4.0.1pl2) the pages that use set_error_handler("my_error_handler"); won't load. Is there some configuration setting that would prevent me from using a custom error handler?

Load Page In Middle Without Anchors
i am using php and have an "update.php" page that is a long list of input forms for an admin user to update database entries. each entry has its own "update" button.

so when the user edits an entry and clicks "update" s/he is directed to a processing script which updates the database and returns the user to "update.php".

heres my problem: the user is returned to the top of page (which is fairly long) so they have to scroll back down every time if they want to edit a number of subsequent entries. i would like the "update" submission to somehow save the current page view so that the user is returned to precisely the same scrolled down view as before.

can this be done without anchors?

i know i could use anchors but am i right that this would cause some scrolling up or down to the nearest anchor in general? i would prefer some way of doing it by percentage, pixels, etc so as to cause a sort of transparent departure and return to the page.

$_SERVER['argv'] Doesn't Have A Value On First Page Load.
when i first load index.php with arguments ie: "index.php?page=x", the
$_SERVER['argv']value is null. I then get the session id appended to
each link. If i refresh the page, I get the $_SERVER['argv'] I want,
but if i click a link $_SERVER['argv'] returns the value I want and
the session id.
Any ideas as to how I can get the $_SERVER['argv'] to return the
arguments on first page load?

INSERT Data On Page Load?
I have an avatar system where certain avatars are locked until the user unlocks them by going to certain pages of the site.

So far ( being the newb I am ) I only know how to INSERT data from a form. Is there a way to do it on page load or similar?

I also need it to first check if the data already exists and if not it inserts the data and then displays a message to the user that they have unlocked the avatar. Code:

Insert To Database On Page Load
I have the code for inserting data to a database form a form (Code below) but I want the data to be entered upon a page loading, how would I do this? Code:

Setting A Cookie On Page Load
How can I set a cookie the first time page loads?

Queries Causing Page To Load Slowly
I'm currently having trouble getting a looped query to display the results in as quick a time as possible. At the moment the query takes far to long...and that's if it executes at all. At the moment i have around 3000 movie titles in the DB.

Can anyone suggest a way of populating the select box in a relatively quick manner?
Here is the code: PHP Code:

PHP Form Processing Hangs Page Load
I am trying to write a simple PHP script to process a form.. the
function seems to be working fine

// subscriber is the users email in the form
if (( $subscriber ) && ($_SERVER['REQUEST_METHOD'] == 'POST') )

thing is while this processing is taking place the page load hangs...
in IE i see nothing the page background, in Firefox (even worse) I get
only 1/2 the page....

I would like the whole page to load the the processign to take place,
except that my PHP is 1/2 way down the page, inside the form

Triggering A Mysql Query On Page Load
I need to trigger a mySQL select query when the page loads. Is there
a way I can do this with PHP, javascript, or some other language?

Page Load Time Show Really High
im running PHP 5.2 on IIS 6 (Windows 2003 Server) and im getting a weird load time result when trying to display page load times on each page. e.g. Page generated in 1193387528.5501 seconds. this is my current code:
<?php
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
echo '<p>Page generated in '.$total_time.' seconds.</p>'."
"; ?>

but i've tried 4 others which are all simular. Any idea as to why it's showing a false result as it's loading in unde 1 second (Dual Xeon 2.8 HT server and connecting over 100mb pipe (college campus)).

Auto Submit Form On Page Load
i have a cronjob to run a php file at a certain time of the day. it originally was suppose to run the php mail function, easy enough, right?? but no, the php mail function is not enabled on the server - just my luck.

all i need to do is send two values from a database table within an email.

i was thinking, i could probably create a form which plugs the two values into fields, and use the mail cgi file to send it that way, but I'd need to submit the form on page load (without someone actually clicking the submit button). I could use javascript, but the cronjob would ignore the javascript.

any ideas?

How Would I Create A Login System With Flash Then Load A Page?
I'm creating a login in system using flash mx, php and mysql. flash is being used to create the fields...i know (i think) how to get the login in working but what i'd like to know is how would i get (once the user has logged in) a page to load in a frame?

any help would be greatly appreciated.

How To Populate Data Into Text Fields On Page Load??
I am creating an account management page that shows the user's contact information and I would like to populate the textfields so that the user doesn't have to type in all his information when he wants to change something.  I want to have him type in only the information he wants to change or update. 

I already have the data displayed on the page. But now I would like to take the data and fill in the textfields with it.

CURL - How To Get URL Of Returned Page?
Is there a way to get the URL of the page that is returned when using Curl?
If I look at CURLINFO_EFFECTIVE_URL value from the return of curlget_info(),
all I see is the URL I requested, not the one that is returned.
I am trying to write an URL checking script against a site that may return a
page other than the one you requested without it being seen as a 302...

Curl / Page Scrape
I'm having trouble using Curl.  Here is the situation.  My goal is to perform an Orbitz hotel search and retrieve the results.  I don't need help with any of the regex stuff (well, i can't even get to that point as of yet).  With this URL ... 
 
http://www.orbitz.com/App/Landing?placementID=1&pageID=41&startDate:useDateText=true&endDate:useDateText=true&city=New+York&startDate:date=07/26/2007&endDate:date=07/27/2007&numberOfRooms=1&adults=1

(as an example, I've put in a search for hotels in New York from 7/26 - 7/27). 

The problem is, it goes to orbitz's "now searching" page, and then I get redirected to the page that actually shows the results.  When I try to use  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); it just autmoatically redirects the page that is performing the CURL to the Orbitz url that shows the results.  Any ideas?

Validation Errors From Displaying On Form Page Load Instead Of Submit
creating two forms and they work fine. Problem is that the validation errors display immediately on page load instead of on submit. Here's the full code for the form parsing: Code:

CURl Get Yahoo! Search Page
I want to use curl get yahoo! search result page.
but it returns null. I read the Yahoo! developer network,and follow the tutorial.But it also returns null.

http://developer.yahoo.com/php/howto-reqRestPhp.html

Curl :: Send XML To A HTTPS Web Page
I'm using PHP to send XML to a HTTPS web page. Everything works fine but can someone help me to remove what I presume is the Curl transfer stats. In the middle of the web page I get the following:

% Total % Received % Xferd Average Speed Time etc etc

$ch=curl_init($url);
curl_setopt($ch,CURLOPT_VERBOSE,0);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,1);
curl_setopt($ch,CURLOPT_POST,0);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_NOPROGRESS,0);
curl_setopt($ch,CURLOPT_HTTPDHEADER,$request_post);
curl_setopt($ch,CURLOPT_POSTFIELDS,"xmlstream=".$request_xml);
$request_result=curl_exec($ch);

Get Form Elements From A Page Using Curl
I am trying to get all form elements on any page using curl. I can get the data no problem but I think the preg_match_all is all screwy because I don't get the results I want. Here is my code: ....

PHP & Javascript New Window Forces Main Page To Load Blank Screen
I have a problem with a call a Javascript "window.open()" function which is
executed as part of a PHP file when a user clicks on an thumbnail image.
The PHP is executed which passes some variables to Javascript to execute
the new window opening. But as it does this, the main window is loaded
which is blank (the browser URL bar shows the URL of the URL passed to the
PHP / Javascript script).

I would like to keep the gallery page visible in the main page which is
where the link originally came from, so the user can see the gallery
underneath the "popup" window of the called graphic.

I don't know how much of an added problem it is, but the script that
generates the whole sites pages is in the root directory, and the gallery
HTML is in some seperate sub-directory and is "included" into the page
layout (using variables passed on a page click).

Gallery script calling the PHP file to execute on image thumbnail click:

<a href="php/pics.php?&gal=coll01&picID=01"><img
src="img/gallery1/s-dg01.jpg" ALT="Picture 1" width="30"
height="69"></A>
<a href="php/pics.php?&gal=coll01&picID=02"><img
src="img/gallery1/s-dg02.jpg" ALT="Picture 2" width="74"
height="69"></A>

This passes the variables to the other PHP script which picture to grab.

PHP file with the Javascript (pics.php):

<?PHP
// Section to generate the Javascript pop-up for correct
// dimentions of the proposed pop-up.

$URL = '..img/gallery1/dg'.$_GET['picID'].'.jpg'

print "<script type="text/javascript">
<!--

var Jurl="$URL";
";

?>

window.
open(Jurl,"Picture","width=370,height=260,toolbar=no,menubar=no,
resizeable=no");

//-->
</script>

Curl Question - Get A Page With Already Posted Data
I would like to get a page with already posted data. I use such code.

$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";

$ch = curl_init();....

Redirecting To Target Page Along With POST With CURL...
I want to send some POST data with cURL and then also redirect to the location where Im sending the POST data. Ive been running around like crazy and unable to find a way. This must be something very simple. Heres what I have thus far, except this doesnt redirect to my target page. Code:

Retrieve Random String From Page Using CURL?
I need to use cURL to get a page, then have it decrypt a random encrypted string, it's just on the page. How might I do this? The encryption type is base64.

PHP CLI Command Line On Win XP Pro Calling External Page With CURL
I wanted to avoid using VBSCRIPT to process a local script running on a win xp pro box. Being that I know php pretty well, I thought I might try it to solve the problem of not knowing vbscript.

I have it running fine on this machine. even have it so I can just type in the php script name instead of c:/php5/php.exe before the script. Cool stuff.

I need to call a php script on another server when this runs and receive a response. (preferrably using POST). I had a test working with vbscript using MS's XMLHTTP.

Not knowing what else to use. I got a quick test working with cURL but it doesnt seem to like the curl_setopt settings. without them, it calls the page (As GET) and receives a response.

So my question is. is there a better method than CURL to receive a response from a script running on the command line? and how can I get it to use POST if I cant use curl_setopt.

Copy A Variable From One Page To Another Page?
How do I copy variable from one page to another page in PHP? For example: I want to put a $var in page A into page B.

Question About Using "global" On One Page Then Using The Variable On Another Page
I am taking over an exisitng app. I have the following function on one
page:

function check($v) {
global $user;
return $user->validate($v[1], $v[0]);
}

And it reference $user on the next page. Register_globals are set on the
existing server but I am moving to a new server where it is not. The code
of the next page is lilke:

session_register('user');
$user=$_SESSION['user'];

I also want to turn it around so it's:
$_SESSION['user'] = $user;

But that fails - $user is empty. By the way, $user is an object.

Any ideas to how to make sure:
$_SESSION['user'] = $user;

How Can I Load Load Additional Extensions ?
My OS is Winxp . My web server is apache 2 which is installed as a NT
service .

My php version is 4.32 , and I extracted it into "c:php" .

I run php as a apache module .

I want to load Additional extensions .They are php_mbstring.dll,
php_xslt.dll and php_domxml.dll .

I have made changes to php.ini as follow.
extension_dir = "c:phpextensions"
extension=php_mbstring.dll
extension=php_xslt.dll
extension=php_domxml.dll

then I restarted apache2 .

but it told me that the modules could not be located .

CURL Problem.. Comparing Output From IE/CURL Differs
I'm writing a tiny php app that will log into our bank of america
account and retrieve a file containing a list of checks that cleared
the previous day. The problem I'm running into is when I perform
actions with php/CURL the output is different than when I use IE and
I'm completely stumped as to why. The final output should list files
available for retrieval but the CURL output displays an error/empty
file message.

Here is the curl portion of my code:

How Do I Take A Variable From One Php Page To Another ?
how do i take a variable from one php page to another ? for example, if i have two variables in 01.php and i want to use them in 02.php...what to do ? if i use the include function, other functions  in 01.php will executed which i don't want...i only want the two variables.

How Do I Take A Variable From One Php Page To Another ?
How do i take a variable from one php page to another ? let's say, i have a variable $c in 01.php...how do i access it from 02.php ?

[HELP PLEASE] Passing Variable To New Page
I am having hard time passing the variable to the next page. May be you can help me. Let me explain:

I am using mySQL database to store information about images (ID, name, author, description, etc). I am pulling some of the information to create this (look at the example here: http://www.gibsonusa.com/test/page/index.php) Now, I want a new window appear when user clicks on the image. I have achieved it with the following script:

echo "<script language="JavaScript">";
echo" function pop1() {";
echo" window.open("info.php?prod_id=$result[0]"); }"; $result[0] is variable that stores id of the image in database
echo "</script>";

I am calling this function in the following manner: echo"<img onclick="pop1();"";

You can see the result if you click on the image. The new page opens up, BUT the id (product_id in this case) value is not passed to the next page correctly. If you click on the first or second image on the first page it shows that the ID is the same for both of them. However if you look at the source code you can see that the ids are assigned correctly. The same thing happens if you click on any image that says “no image available” (I am using different script to generate those). It seems that the script picks up and stores in the memory the value of an ID of the last image generated with the script (I don’t know if that make sense).

Oh, by the way the contents of info.php that I am calling in the script above are as following:

<?
$myid = $_GET['prod_id'];
echo" Product ID: $myid<br>";
?>

What am I doing wrong? Can you help?
Thank you.

Passing A Variable To A Page
Is it possible to pass a varialble to a page using just PHP/HTML. The object is to create a agenda page, with information comming from MySql, based on the choise of month in the index page in a different frame, i.e. the month is selected in frame 1.

Now i want to sent the choice of the user to a page, to be shown in frame 2, that is created with PHP, and use the variable in the MySql query.I know this can be done using java, but i would like to avoid that.


Copyright © 2005-08 www.BigResource.com, All rights reserved