Пхп инсерт на JS

C++ JAVA
Post Reply
choko_h
Нов
Нов
Posts: 132
Joined: Thu Jul 13, 2006 1:15 pm
Location: Търговище
Contact:

Пхп инсерт на JS

Post by choko_h » Thu Jul 12, 2007 9:25 am

Значи въпросът ми е как мога да вкарам този JS код :

Code: Select all

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" /*UPHACKS,com*/>
<!-- Begin
if &#40;window != top&#41; top.location.href = location.href;
// End -->
</SCRIPT> 
във индекса на сайта ми :

Code: Select all

<?php
/**
* @version $Id&#58; index.php 6022 2006-12-18 22&#58;30&#58;07Z friesengeist $
* @package Joomla
* @copyright Copyright &#40;C&#41; 2002 - 2007 &#196;&#230;&#243;&#236;&#235;&#224;! &#193;&#250;&#235;&#227;&#224;&#240;&#232;&#255;
* @license http&#58;//www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// Set flag that this is a parent file
define&#40; '_VALID_MOS', 1 &#41;;

// checks for configuration file, if none found loads installation page
if &#40;!file_exists&#40; 'configuration.php' &#41; || filesize&#40; 'configuration.php' &#41; < 10&#41; &#123;
	$self = rtrim&#40; dirname&#40; $_SERVER&#91;'PHP_SELF'&#93; &#41;, '/\\' &#41; . '/';
	header&#40;"Location&#58; http&#58;//" . $_SERVER&#91;'HTTP_HOST'&#93; . $self . "installation/index.php" &#41;;
	exit&#40;&#41;;
&#125;

require&#40; 'globals.php' &#41;;
require_once&#40; 'configuration.php' &#41;;

// SSL check - $http_host returns <live site url>&#58;<port number if it is 443>
$http_host = explode&#40;'&#58;', $_SERVER&#91;'HTTP_HOST'&#93; &#41;;
if&#40; &#40;!empty&#40; $_SERVER&#91;'HTTPS'&#93; &#41; && strtolower&#40; $_SERVER&#91;'HTTPS'&#93; &#41; != 'off' || isset&#40; $http_host&#91;1&#93; &#41; && $http_host&#91;1&#93; == 443&#41; && substr&#40; $mosConfig_live_site, 0, 8 &#41; != 'https&#58;//' &#41; &#123;
	$mosConfig_live_site = 'https&#58;//'.substr&#40; $mosConfig_live_site, 7 &#41;;
&#125;

require_once&#40; 'includes/joomla.php' &#41;;

//Installation sub folder check, removed for work with SVN
if &#40;file_exists&#40; 'installation/index.php' &#41; && $_VERSION->SVN == 0&#41; &#123;
	define&#40; '_INSTALL_CHECK', 1 &#41;;
	include &#40; $mosConfig_absolute_path .'/offline.php'&#41;;
	exit&#40;&#41;;
&#125;

// displays offline/maintanance page or bar
if &#40;$mosConfig_offline == 1&#41; &#123;
	require&#40; $mosConfig_absolute_path .'/offline.php' &#41;;
&#125;

// load system bot group
$_MAMBOTS->loadBotGroup&#40; 'system' &#41;;

// trigger the onStart events
$_MAMBOTS->trigger&#40; 'onStart' &#41;;

if &#40;file_exists&#40; $mosConfig_absolute_path .'/components/com_sef/sef.php' &#41;&#41; &#123;
	require_once&#40; $mosConfig_absolute_path .'/components/com_sef/sef.php' &#41;;
&#125; else &#123;
	require_once&#40; $mosConfig_absolute_path .'/includes/sef.php' &#41;;
&#125;
require_once&#40; $mosConfig_absolute_path .'/includes/frontend.php' &#41;;

// retrieve some expected url &#40;or form&#41; arguments
$option = strval&#40; strtolower&#40; mosGetParam&#40; $_REQUEST, 'option' &#41; &#41; &#41;;
$Itemid = intval&#40; mosGetParam&#40; $_REQUEST, 'Itemid', null &#41; &#41;;

if &#40;$option == ''&#41; &#123;
	if &#40;$Itemid&#41; &#123;
		$query = "SELECT id, link"
		. "\n FROM #__menu"
		. "\n WHERE menutype = 'mainmenu'"
		. "\n AND id = " . &#40;int&#41; $Itemid
		. "\n AND published = 1"
		;
		$database->setQuery&#40; $query &#41;;
	&#125; else &#123;
		$query = "SELECT id, link"
		. "\n FROM #__menu"
		. "\n WHERE menutype = 'mainmenu'"
		. "\n AND published = 1"
		. "\n ORDER BY parent, ordering"
		;
		$database->setQuery&#40; $query, 0, 1 &#41;;
	&#125;
	$menu = new mosMenu&#40; $database &#41;;
	if &#40;$database->loadObject&#40; $menu &#41;&#41; &#123;
		$Itemid = $menu->id;
	&#125;
	$link = $menu->link;
	if &#40;&#40;$pos = strpos&#40; $link, '?' &#41;&#41; !== false&#41; &#123;
		$link = substr&#40; $link, $pos+1 &#41;. '&Itemid='.$Itemid;
	&#125;
	parse_str&#40; $link, $temp &#41;;
	/** this is a patch, need to rework when globals are handled better */
	foreach &#40;$temp as $k=>$v&#41; &#123;
		$GLOBALS&#91;$k&#93; = $v;
		$_REQUEST&#91;$k&#93; = $v;
		if &#40;$k == 'option'&#41; &#123;
			$option = $v;
		&#125;
	&#125;
&#125;
if &#40; !$Itemid &#41; &#123;
// when no Itemid give a default value
	$Itemid = 99999999;
&#125;

// mainframe is an API workhorse, lots of 'core' interaction routines
$mainframe = new mosMainFrame&#40; $database, $option, '.' &#41;;
$mainframe->initSession&#40;&#41;;

// trigger the onAfterStart events
$_MAMBOTS->trigger&#40; 'onAfterStart' &#41;;

// checking if we can find the Itemid thru the content
if &#40; $option == 'com_content' && $Itemid === 0 &#41; &#123;
	$id 	= intval&#40; mosGetParam&#40; $_REQUEST, 'id', 0 &#41; &#41;;
	$Itemid = $mainframe->getItemid&#40; $id &#41;;
&#125;

/** do we have a valid Itemid yet?? */
if &#40; $Itemid === 0 &#41; &#123;
	/** Nope, just use the homepage then. */
	$query = "SELECT id"
	. "\n FROM #__menu"
	. "\n WHERE menutype = 'mainmenu'"
	. "\n AND published = 1"
	. "\n ORDER BY parent, ordering"
	;
	$database->setQuery&#40; $query, 0, 1 &#41;;
	$Itemid = $database->loadResult&#40;&#41;;
&#125;

// patch to lessen the impact on templates
if &#40;$option == 'search'&#41; &#123;
	$option = 'com_search';
&#125;

// loads english language file by default
if &#40;$mosConfig_lang==''&#41; &#123;
	$mosConfig_lang = 'english';
&#125;
include_once&#40; $mosConfig_absolute_path .'/language/' . $mosConfig_lang . '.php' &#41;;

// frontend login & logout controls
$return 	= strval&#40; mosGetParam&#40; $_REQUEST, 'return', NULL &#41; &#41;;
$message 	= intval&#40; mosGetParam&#40; $_POST, 'message', 0 &#41; &#41;;
if &#40;$option == 'login'&#41; &#123;
	$mainframe->login&#40;&#41;;

	// JS Popup message
	if &#40; $message &#41; &#123;
		?>
		<script language="javascript" type="text/javascript">
		<!--//
		alert&#40; "<?php echo addslashes&#40; _LOGIN_SUCCESS &#41;; ?>" &#41;;
		//-->
		</script>
		<?php
	&#125;

	if &#40; $return && !&#40; strpos&#40; $return, 'com_registration' &#41; || strpos&#40; $return, 'com_login' &#41; &#41; &#41; &#123;
	// checks for the presence of a return url
	// and ensures that this url is not the registration or login pages
		// If a sessioncookie exists, redirect to the given page. Otherwise, take an extra round for a cookiecheck
		if &#40;isset&#40; $_COOKIE&#91;mosMainFrame&#58;&#58;sessionCookieName&#40;&#41;&#93; &#41;&#41; &#123;
			mosRedirect&#40; $return &#41;;
		&#125; else &#123;
			mosRedirect&#40; $mosConfig_live_site .'/index.php?option=cookiecheck&return=' . urlencode&#40; $return &#41; &#41;;
		&#125;
	&#125; else &#123;
		// If a sessioncookie exists, redirect to the start page. Otherwise, take an extra round for a cookiecheck
		if &#40;isset&#40; $_COOKIE&#91;mosMainFrame&#58;&#58;sessionCookieName&#40;&#41;&#93; &#41;&#41; &#123;
			mosRedirect&#40; $mosConfig_live_site .'/index.php' &#41;;
		&#125; else &#123;
			mosRedirect&#40; $mosConfig_live_site .'/index.php?option=cookiecheck&return=' . urlencode&#40; $mosConfig_live_site .'/index.php' &#41; &#41;;
		&#125;
	&#125;

&#125; else if &#40;$option == 'logout'&#41; &#123;
	$mainframe->logout&#40;&#41;;

	// JS Popup message
	if &#40; $message &#41; &#123;
		?>
		<script language="javascript" type="text/javascript">
		<!--//
		alert&#40; "<?php echo addslashes&#40; _LOGOUT_SUCCESS &#41;; ?>" &#41;;
		//-->
		</script>
		<?php
	&#125;

	if &#40; $return && !&#40; strpos&#40; $return, 'com_registration' &#41; || strpos&#40; $return, 'com_login' &#41; &#41; &#41; &#123;
	// checks for the presence of a return url
	// and ensures that this url is not the registration or logout pages
		mosRedirect&#40; $return &#41;;
	&#125; else &#123;
		mosRedirect&#40; $mosConfig_live_site.'/index.php' &#41;;
	&#125;
&#125; else if &#40;$option == 'cookiecheck'&#41; &#123;
	// No cookie was set upon login. If it is set now, redirect to the given page. Otherwise, show error message.
	if &#40;isset&#40; $_COOKIE&#91;mosMainFrame&#58;&#58;sessionCookieName&#40;&#41;&#93; &#41;&#41; &#123;
		mosRedirect&#40; $return &#41;;
	&#125; else &#123;
		mosErrorAlert&#40; _ALERT_ENABLED &#41;;
	&#125;
&#125;

/** get the information about the current user from the sessions table */
$my = $mainframe->getUser&#40;&#41;;

// detect first visit
$mainframe->detect&#40;&#41;;

// set for overlib check
$mainframe->set&#40; 'loadOverlib', false &#41;;

$gid = intval&#40; $my->gid &#41;;

// gets template for page
$cur_template = $mainframe->getTemplate&#40;&#41;;
/** temp fix - this feature is currently disabled */

/** @global A places to store information from processing of the component */
$_MOS_OPTION = array&#40;&#41;;

// precapture the output of the component
require_once&#40; $mosConfig_absolute_path . '/editor/editor.php' &#41;;

ob_start&#40;&#41;;

if &#40;$path = $mainframe->getPath&#40; 'front' &#41;&#41; &#123;
	$task 	= strval&#40; mosGetParam&#40; $_REQUEST, 'task', '' &#41; &#41;;
	$ret 	= mosMenuCheck&#40; $Itemid, $option, $task, $gid &#41;;

	if &#40;$ret&#41; &#123;
		require_once&#40; $path &#41;;
	&#125; else &#123;
		mosNotAuth&#40;&#41;;
	&#125;
&#125; else &#123;
	header&#40; 'HTTP/1.0 404 Not Found' &#41;;
	echo _NOT_EXIST;
&#125;

$_MOS_OPTION&#91;'buffer'&#93; = ob_get_contents&#40;&#41;;

ob_end_clean&#40;&#41;;

initGzip&#40;&#41;;

header&#40; 'Expires&#58; Mon, 26 Jul 1997 05&#58;00&#58;00 GMT' &#41;;
header&#40; 'Last-Modified&#58; ' . gmdate&#40; 'D, d M Y H&#58;i&#58;s' &#41; . ' GMT' &#41;;
header&#40; 'Cache-Control&#58; no-store, no-cache, must-revalidate' &#41;;
header&#40; 'Cache-Control&#58; post-check=0, pre-check=0', false &#41;;
header&#40; 'Pragma&#58; no-cache' &#41;;

// display the offline alert if an admin is logged in
if &#40;defined&#40; '_ADMIN_OFFLINE' &#41;&#41; &#123;
	include&#40; $mosConfig_absolute_path .'/offlinebar.php' &#41;;
&#125;

// loads template file
if &#40; !file_exists&#40; $mosConfig_absolute_path .'/templates/'. $cur_template .'/index.php' &#41; &#41; &#123;
	echo _TEMPLATE_WARN . $cur_template;
&#125; else &#123;
	require_once&#40; $mosConfig_absolute_path .'/templates/'. $cur_template .'/index.php' &#41;;
	echo '<!-- '. time&#40;&#41; .' -->';
&#125;

// displays queries performed for page
if &#40;$mosConfig_debug&#41; &#123;
	echo $database->_ticker . ' queries executed';
	echo '<pre>';
 	foreach &#40;$database->_log as $k=>$sql&#41; &#123;
 		echo $k+1 . "\n" . $sql . '<hr />';
	&#125;
	echo '</pre>';
&#125;

doGzip&#40;&#41;;
?>
:oops:

User avatar
The_Killer
Турист
Турист
Posts: 425
Joined: Fri Apr 06, 2007 9:55 am
Answers: 23
Location: Varna, Bulgaria

Post by The_Killer » Thu Jul 12, 2007 9:44 am

Еми най-отгоре сложи това:

Code: Select all

<html>
<head>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" /*UPHACKS,com*/> 
<!-- Begin 
if &#40;window != top&#41; top.location.href = location.href; 
// End --> 
</SCRIPT> 
</head>
</html> 
Така трябва да стане :)

а може и така:

Code: Select all

echo "<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" /*UPHACKS,com*/> 
<!-- Begin 
if &#40;window != top&#41; top.location.href = location.href; 
// End --> 
</SCRIPT> ";

choko_h
Нов
Нов
Posts: 132
Joined: Thu Jul 13, 2006 1:15 pm
Location: Търговище
Contact:

Post by choko_h » Thu Jul 12, 2007 9:53 am

пробвам и дваат варианта и при двата дава грешка :shock:

User avatar
xainiken
Нов
Нов
Posts: 47
Joined: Thu May 24, 2007 12:19 pm
Location: LaS VeGaS :)

Post by xainiken » Thu Jul 12, 2007 9:55 am

Каква грешка ?

choko_h
Нов
Нов
Posts: 132
Joined: Thu Jul 13, 2006 1:15 pm
Location: Търговище
Contact:

Post by choko_h » Thu Jul 12, 2007 10:14 am

ми дава грешки на абсолютно сичките редове на кода който The_Killer ми написа нз що така

User avatar
The_Killer
Турист
Турист
Posts: 425
Joined: Fri Apr 06, 2007 9:55 am
Answers: 23
Location: Varna, Bulgaria

Post by The_Killer » Thu Jul 12, 2007 10:15 am

choko_h wrote:ми дава грешки на абсолютно сичките редове на кода който The_Killer ми написа нз що така


копирай точно какво ти изписва...

choko_h
Нов
Нов
Posts: 132
Joined: Thu Jul 13, 2006 1:15 pm
Location: Търговище
Contact:

Post by choko_h » Thu Jul 12, 2007 10:21 am

Warning: Cannot modify header information - headers already sent by (output started at /home/lnsbg/public_html/mp3box-bg/index.php:3) in /home/lnsbg/public_html/mp3box-bg/globals.php on line 136

Warning: Cannot modify header information - headers already sent by (output started at /home/lnsbg/public_html/mp3box-bg/index.php:3) in /home/lnsbg/public_html/mp3box-bg/index.php on line 259

Warning: Cannot modify header information - headers already sent by (output started at /home/lnsbg/public_html/mp3box-bg/index.php:3) in /home/lnsbg/public_html/mp3box-bg/index.php on line 260

Warning: Cannot modify header information - headers already sent by (output started at /home/lnsbg/public_html/mp3box-bg/index.php:3) in /home/lnsbg/public_html/mp3box-bg/index.php on line 261

Warning: Cannot modify header information - headers already sent by (output started at /home/lnsbg/public_html/mp3box-bg/index.php:3) in /home/lnsbg/public_html/mp3box-bg/index.php on line 262

Warning: Cannot modify header information - headers already sent by (output started at /home/lnsbg/public_html/mp3box-bg/index.php:3) in /home/lnsbg/public_html/mp3box-bg/index.php on line 263

User avatar
The_Killer
Турист
Турист
Posts: 425
Joined: Fri Apr 06, 2007 9:55 am
Answers: 23
Location: Varna, Bulgaria

Post by The_Killer » Thu Jul 12, 2007 10:23 am

Я пробвай само така

Code: Select all

<html> 
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" /*UPHACKS,com*/> 
<!-- Begin 
if &#40;window != top&#41; top.location.href = location.href; 
// End --> 
</SCRIPT> 
</html>


това най-отгоре.

User avatar
mute
Шаман
Шаман
Posts: 3127
Joined: Sun Sep 25, 2005 10:14 pm
Answers: 167
Location: between mind & heart
Contact:

Post by mute » Thu Jul 12, 2007 10:30 am

пробвай като сложиш в началото на кода който добавяш функцията
ob_start() а в края ob_end_clean()
може и да бъркам функциите

choko_h
Нов
Нов
Posts: 132
Joined: Thu Jul 13, 2006 1:15 pm
Location: Търговище
Contact:

Post by choko_h » Thu Jul 12, 2007 10:50 am

mute 10x човече печелиш точка стана 10х и на другите :)

Post Reply