Jump to content

php help needed


ryanteck

Recommended Posts

well im stuck a little bit

im trying to create a script wich is able to grab a var and use it to get a bit of code from another site

 

eg

var=Sojobo-taro

submit will then Find In Page habborp.com/home/?name=var

find: 

<img alt="Var" src="http://www.habbo.co.uk/habbo-imaging/avatarimage?figure=hr-802-45.hd-190-1.ch-886-100.lg-285-110.sh-906-110.ea-1404-110.fa-1201-.wa-2009-110&size=b&direction=4&head_direction=4&gesture=sm l" />

 

Then I Need It TO Copy figure=hr-802-45.hd-190-1.ch-...=4&gesture=sml And Place It In The Code

Thanks A Lot

Ryanteck

Link to comment
https://forums.phpfreaks.com/topic/183975-php-help-needed/
Share on other sites

u can use this code

<?php $url_feed='http://google.com';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://validator.w3.org/feed/check.cgi?url=$url_feed");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
$output = curl_exec($ch);

$fh = fopen("out.txt", 'w');
fwrite($fh, $output);
$value='<img alt="Var" src=';
$section = file_get_contents('./out.txt', NULL, NULL, 1256, 95);
/*echo $section;
$fh1=fopen("out_1.txt",'w');
fwrite($fh1, $section);
fclose($fh1);
var_dump($section);*/
fclose($fh);
curl_close($ch);
?>

 

but after this u need to scan the entire txt file for these characters and display the result..

or else it it comes at a particular place u can use it of directly

Link to comment
https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-971190
Share on other sites

well im stuck a little bit

im trying to create a script wich is able to grab a var and use it to get a bit of code from another site

 

eg

var=Sojobo-taro

submit will then Find In Page habborp.com/home/?name=var

find: 

<img alt="Var" src="http://www.habbo.co.uk/habbo-imaging/avatarimage?figure=hr-802-45.hd-190-1.ch-886-100.lg-285-110.sh-906-110.ea-1404-110.fa-1201-.wa-2009-110&size=b&direction=4&head_direction=4&gesture=sm l" />

 

Then I Need It TO Copy figure=hr-802-45.hd-190-1.ch-...=4&gesture=sml And Place It In The Code

Thanks A Lot

Ryanteck

Link to comment
https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-971318
Share on other sites

<?php
$user = 'Sojobo-Taro';
$html = file_get_contents('http://habborp.com/home/?name='.$user);
$doc = new DOMDocument();
@$doc->loadHTML($html);
$xpath = new DOMXPath($doc);

$results = $xpath->query("//div[@class='profile-figure']/img");

if (!is_null($results)) 
{
    foreach ($results as $result)
    {
        echo $result->getAttribute('src');
    }
}
?>

will get the link now i need to code it into

<?php

if(isset($_POST['imager']))

{

 

$name = $_POST['name'];

$action = $_POST['action'];

$direction = $_POST['direction'];

$h_direction = $_POST['h_direction'];

$gesture = $_POST['gesture'];

$size = $_POST['size'];

echo("<p align=\"center\">Your result..</p><p align=\"center\"><img src=\"(Where The Figure Id Goes)" . $name . "&action=" . $action . "&direction=" . $direction . "&head_direction=" . $h_direction . "&gesture=" . $gesture . "&size=" . $size . "\" alt=\"This habbo does not exist\" /></p>");

 

please help!

Link to comment
https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-971365
Share on other sites

hai

i found a resolution for my problem..

hope this might help you out..

 

<?php
$url_feed='http://google.com';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://validator.w3.org/feed/check.cgi?url=$url_feed");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
$output = curl_exec($ch);

$fh = fopen("out.txt", 'w');
fwrite($fh, $output);
$value1='Congratulations!';
$value='img alt="[Valid RSS]" title="Valid RSS" src="images/valid-rss.png" /> This is a valid RSS feed.';
$file=file_get_contents("out.txt");
//echo $file;
$result=stristr($file,$value1);
$fh1 = fopen("out1.txt", 'w');
fwrite($fh1,$result);
$section = file_get_contents('./out1.txt', NULL, NULL, 39, 95);
//echo $section;
if($section==$value)
{
    echo "Success";
}
else
{
    echo "The test case Failed";
}

fclose($fh);
fclose($fh1);
curl_close($ch);
?>

 

so here actually wht i am doing is that i am cutting the things that would be published above a particular keyword. and storing it in the out1.txt..

this would give the resultant things in which i need to check and i am scan only these for the validation..

:P

Link to comment
https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-972695
Share on other sites

dude

i got tired of telling the same to everyone.. >:(

i used the preg function and the damn thing is not working for me..

so i am using the curl function.

i wrote this to find out whether the given url is a valid Rss feed or not..

if u can give me a better solution that would be greatly appreciated.. :P

 

i have used this function to check that

!@$xml=simplexml_load_file("$subscr")

 

after which i have tried the preg..and the funny thing is that preg will not work here as the urls for these feeds will not have common things for different sites

 

 

Link to comment
https://forums.phpfreaks.com/topic/183975-php-help-needed/#findComment-972700
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.