FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Help with php code





jayandsilo
So I have a phpnuke site up, and I need to edit the code. The code point points to the file locally, but I would be too confused to be able to do it for the page I want as the link, so how do I insert a hyperlink instead of local page into this code. It should be fairly easy:

href=\"modules.php?name=Top\">Top 10</a> \n"

Thanks.
Roald
What do you mean? I don't understand your explanation.
Fire Boar
echo "<a href=\"mysitefolder/thepageiwanttolinkto.php\">Whatever you want the title to be</a> \n";

Try that, use the root path of the page you want to link to reletive to the location of the page you're at (in this case it's inside a folder which is in the same directory as the page you're on) between the \" symbols.
Roald
Fire Boar wrote:
Code:
echo "<a href=\"mysitefolder/thepageiwanttolinkto.php\">Whatever you want the title to be</a> \n";
You're wrong, you'll get a parse error. It has to be:
Code:
echo "<a href=\'mysitefolder/thepageiwanttolinkto.php\'>Whatever you want the title to be</a> \n";
You may not use " inside the echo "...";
mathiaus
Roald wrote:
You may not use " inside the echo "...";

Eh? You can if its slashed which it was in the code so it should work with no parse errors.
Rhysige
I usually use echo '<tags "">'; but thats just preferance so I can use normal tags.. Mathi is right he has slashed the tags they will work without error.
jayandsilo
actually I'm using phpnuke and I change it to modules.php?name=Video&op=submit_video which theoretically should have worked, but there is an error something like 'unexpected '=' on line 22, theme.php, which is the file I'm changing.
Rhysige
can you paste about 2 lines before + after that line please.
Roald
mathiaus wrote:
Roald wrote:
You may not use " inside the echo "...";

Eh? You can if its slashed which it was in the code so it should work with no parse errors.
Oh damn Embarassed well, I learned something new today Very Happy
Maxus
Roald wrote:
mathiaus wrote:
Roald wrote:
You may not use " inside the echo "...";

Eh? You can if its slashed which it was in the code so it should work with no parse errors.
Oh damn Embarassed well, I learned something new today Very Happy

in stead of " use \" ant it will work fine
Rhysige
Maxus READ WHAT YOU QUOTE! Seriously it annoys me if people come into a thread read the last post and think they can comment on it... You just said exactly what had already been said to him AND what he was acknowledging.. This thread isnt ever more than a page.. if it was 2 pages ago someone said it maby you could be forgiven for not reading it but it was about 2 posts ago.
Related topics
Show PHP Code
need some help - php switch code
PHP CODE INCLUSION
mySQL Query/PHP code - get the highest value...
my PHP code benchmark script that got some problems
PHP code snippit?
CSS for making images go through a php code.
Gradient Fill Cell
What is a good or bad php code?
I want PHP Code to ......
[help][php] Ayuda con las cadenas
[HELP] PHP (and some MyBB) Administration
Help With Simple PHP Code Snipit
removing DirectAdmin part of URL makes php code work
Highlight PHP-code in a HTML-document
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.