Jump to content

Force display of text through API


The Little Guy

Recommended Posts

I am making an API, and I would like to know how I could force the user to display: "Powered by Nebala.com"

 

currently I have this in the class:

echo '<div>Powered by <a href="http://nebala.com">Nebala.com</a></div>';

 

With the following the user could easily remove this:

<?php
class Question extends Nebala{
public function __construct($key, $id){
	$this->key = $key;
	$this->id = $id;
	$this->action = 'question';
	echo '<div>Powered by <a href="http://nebala.com">Nebala.com</a></div>';
}
public function getQuestion($q = null){
	if(!is_null($q)){
		$this->url = $this->setURL($q);
		$this->connect();
		return unserialize($this->content);
	}else{
		return false;
	}
}
}
?>

 

I have tried putting that in the return information, on the site:

 

<?php
while($row = mysql_fetch_assoc($sql)){
$arr[] = $row;
}
echo <div>Powered by <a href="http://nebala.com">Nebala.com</a></div>';
echo serialize($arr);
exit;
?>

 

but that doesn't work, it just wrecks the PHP for the clients api code.

 

how could I do this?

Link to comment
https://forums.phpfreaks.com/topic/187205-force-display-of-text-through-api/
Share on other sites

Obfuscation is worthless for security, but I'd obviously bet you 95% of your clients would not take the time to browse timelessly through the script and attempt to view where the code is. You can add this: (your original message)

echo '<script language="Javascript">document.write(unescape(\'%3C%64%69%76%3E%50%6F%77%65%72%65%64%20%62%79%20%3C%61%20%68%72%65%66%3D%22%68%74%74%70%3A%2F%2F%6E%65%62%61%6C%61%2E%63%6F%6D%22%3E%4E%65%62%61%6C%61%2E%63%6F%6D%3C%2F%61%3E%3C%2F%64%69%76%3E\'))</script>';

 

Or using JS escapes, base64_decode on an already coded string etc.. They'd look inconspicuous enough for most people. It's only a brandmark.

 

EDIT: Fixed code.

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.