开发者

data between two php files

开发者 https://www.devze.com 2023-03-16 10:02 出处:网络
I have this php script: <?php include(\"simple_html_dom.php\"); $url = \"http://en.wikipedia.org/wiki/Thailand\";

I have this php script:

<?php
include("simple_html_dom.php");
$url = "http://en.wikipedia.org/wiki/Thailand";
echo file_get_html($url);
?>

How can I send the $url variable to my tosql.php script ?

I apologize for not including more about what Im doing. Im actually sending this url to a jquery script which sends this to a php script titled tosql.php (which stores the processed data into mysq开发者_如何学JAVAl from the jquery script)


This should do what you want.

<?php
$url = "http://en.wikipedia.org/wiki/Thailand";
include("simple_html_dom.php");
echo file_get_html($url);
?>

By declaring $url before your include, it's basically the same as declaring $url at the very top of simple_html_dom.php.

0

精彩评论

暂无评论...
验证码 换一张
取 消