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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.