Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Old 03-20-2004, 11:20 AM   #1 (permalink)
Junior Member
 
Join Date: 03-20-04
Posts: 3
iTrader: 0 / 0%
Latest Blog:
None

enigmafyv is liked by many
Why is this block wrong?

Can someone tell me what's wrong with my script? I'm really new (newbie, noob, whatever) to php and I was trying to make my own block. So I thought I would try and use help from PHPNukeFiles.com and input my code into the 'html to php' tool and it gave me something a little different than what's posted below, but I made some modifications because that didn't work, so now I'm trying what's posted below. Can someone pls help?

Quote:
<?php

/**********************/
/* Your credits go here */
/**********************/

if(!eregi("block-norton.php", $_SERVER['PHP_SELF'])){
header("Location: index.php");
}

$content .= "<html>";

$content .= "<head>";
$content .= "<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">";
$content .="<title></title>";
$content .="</head>";

$content .="<body>";

$content .="<script src="http://securityresponse.symantec.com/avcenter/js/vir.js"></script>";
$content .="<script src="http://securityresponse.symantec.com/avcenter/js/tools.js"></script>";
$content .="<script src="http://securityresponse.symantec.com/avcenter/js/advis.js"></script>";
$content .="<script src="http://securityresponse.symantec.com/avcenter/js/vir_display.js"></script>";
$content .="<script>";
$content .="symDisplay();";
$content .="</script>";

$content .="</body>";

$content .="</html>";


if(!eregi("block-norton.php", $_SERVER['PHP_SELF'])){
header("Location: index.php");
}
By the way, when I preview my html script in it's own page, it displays properly, so I know I have something setup wrong with the PHP script.
enigmafyv is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-20-2004, 11:37 AM   #2 (permalink)
Possible Terrorist
 
kwvarga's Avatar
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,504
iTrader: 0 / 0%
kwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web pro
Send a message via AIM to kwvarga
chang every " that is indie the html tags to \"

so like
.="<script src="http

would be

.="<script src=\"http


dont change the .= " or the "; ones.. just the ones that are inside < >
__________________
http://www.kylevarga.com - My blog.
kwvarga is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-20-2004, 11:48 AM   #3 (permalink)
Junior Member
 
Join Date: 03-20-04
Posts: 3
iTrader: 0 / 0%
Latest Blog:
None

enigmafyv is liked by many
So even in the meta tag I change everything that's in the <> into \"?

And also at the end of each line, I don't make them nested do I?

(i.e. <\"content"\> Or does it got <\"content\">?)
enigmafyv is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-20-2004, 11:53 AM   #4 (permalink)
Possible Terrorist
 
kwvarga's Avatar
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,504
iTrader: 0 / 0%
kwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web pro
Send a message via AIM to kwvarga
well heres the logic

" opens up a string.. you want it to actually display the " you put \" because " would close the string. \" basically says.. dont close the string, but add this in.
__________________
http://www.kylevarga.com - My blog.
kwvarga is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-20-2004, 02:24 PM   #5 (permalink)
Junior Member
 
Join Date: 03-20-04
Posts: 3
iTrader: 0 / 0%
Latest Blog:
None

enigmafyv is liked by many
OK, here's the changes I've made to the script (in red). According to what you've told me, this should work. But unfortunately it's not.

I'm getting this error on my page:
Parse error: parse error in /homepages/12/d123456789/htdocs/nuke/blocks/block-norton.php on line 12

Now does this acutally mean line 12 of the php file? If so I've denoted which line line 12 is by highlighting it in green. Unless it means the 12th line of code which would be colored in teal.
Quote:
<?php

/**********************/
/* Your credits go here */
/**********************/

if(!eregi("block-norton.php", $_SERVER['PHP_SELF'])){
header("Location: index.php");
}
$content .="<html>";

$content .="<head>";
$content .="<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\">";
$content .="<title></title>";
$content .="</head>";

$content .="<body>";
$content .="<script src=\"http://securityresponse.symantec.com/avcenter/js/vir.js\"></script>";
$content .="<script src=\"http://securityresponse.symantec.com/avcenter/js/tools.js\"></script>";
$content .="<script src=\"http://securityresponse.symantec.com/avcenter/js/advis.js\"></script>";
$content .="<script src=\"http://securityresponse.symantec.com/avcenter/js/vir_display.js\"></script>";
$content .="<script>";
$content .="symDisplay();";
$content .="</script>";

$content .="</body>";

$content .="</html>";



if(!eregi("block-norton.php", $_SERVER['PHP_SELF'])){
header("Location: index.php");
}
enigmafyv is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-20-2004, 05:32 PM   #6 (permalink)
Moderator
 
LazyJim's Avatar
 
Join Date: 10-13-03
Location: UK
Posts: 2,468
iTrader: 0 / 0%
Latest Blog:
None

LazyJim is a splendid one to beholdLazyJim is a splendid one to beholdLazyJim is a splendid one to beholdLazyJim is a splendid one to beholdLazyJim is a splendid one to beholdLazyJim is a splendid one to beholdLazyJim is a splendid one to beholdLazyJim is a splendid one to beholdLazyJim is a splendid one to beholdLazyJim is a splendid one to beholdLazyJim is a splendid one to behold
Send a message via MSN to LazyJim
Quote:
$content .="<html>";
I think that's your problem

.= means append, but the variable has to be set before you can append to it.

So change the first line with $content to
[code:1:ee69d56483] $content ="<html>";[/code:1:ee69d56483]
(take the dot out)
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
LazyJim is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrong Traffic, Wrong Keyword for Wrong Site! Jonathan_Hue SEO Forum 22 03-18-2008 06:33 PM


Sponsor Links
Get exposure! Contextual Links V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 10:35 AM.
© Copyright 2008 V7 Inc
Powered by vBulletin
Copyright © 2000-2009 Jelsoft Enterprises Limited.


Search Engine Optimization by vBSEO 3.3.0 ©2009, Crawlability, Inc.