hey well i want to include this subdomain information onto my website using the include function in php, so here is the link to the sub domain. http://shop.safetynetdirect.com/cgi-bin/mk_cat.pl?cat=B_NG1 Now i've tried using using_once('http://shop.safetynetdirect.com/cgi-bin/mk_cat.pl?cat=B_NG1') but it gives me errors, so i checked my php info and saw that allow_url_include is set to off, is this the problem ???
You can only include another php file, not a full page of html.. Also, when including make sure you use the relative path.
but i cnt use the relative path can i because its on a sub domain. And i'm tryin to avoid iframes at all costs so do you know another way i cld grab this information variable from the url.
i tried this <?php $handle = fopen("http://safetynetdirect.com/tcs/index.php", "r"); echo " $handle "; ?> but all i get is this text resource id#5 any ideas,
The handle is just a pointer to the file resource. You have to use fread to get to the content. http://tr2.php.net/manual/en/function.fread.php $handle = fopen("http://safetynetdirect.com/tcs/index.php", "r"); $contents = ''; while (!feof($handle)) { $contents .= fread($handle, 8192); } fclose($handle); echo $content; Code (markup):
You will need this: <? $c = file_get_contents("http://shop.safetynetdirect.com/cgi-bin/mk_cat.pl?cat=B_NG1"); echo $c; ?> PHP:
try: $file = file_get_contents('http://shop.safetynetdirect.com/cgi-bin/mk_cat.pl?cat=B_NG1'); echo $file; PHP: If you only want to display part of the page you could use regexp to match unique parts of the html EDIT: few seconds too late.. haha
is there no way other way i can get around gettin this information then, rather then using a iframe ?
ok iv'e tried this but looks what happens because was on subdomain images are now broken. http://safetynetdirect.com/tcs/?pg=test this is the page with file_get_contents
OK now you can make some work to $c before you echo it. For example, use a regular expression that checks for images without full URL and adds the URL to them.
i want to use get file contents but look at the link i have given, now the image links are broken and bottons. o and thanks alot everyone for tryin to help
ok thanks alot i get what u mean now, if anyone has any snippits for code for this i wld appreciate it il look into it now !!!
If you need an advice, then I would say google for it before you get help because regular expressions need searching and reading before you use them. And they will open a new horizon for you
yeah ive read like 3 php books so i know about regular expressions just haven't really used them to much apart from checking a email is valid ect. thanks for advice
LOOOOL OK I checked the page and found that they use this format for images: <img src="/ So, you can create your expression on this. But BTW: I checked their page now and it is changed! It shows a hand in gloves, what happened?