Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
how will this bad html work?
Old 12-16-2005, 02:58 PM how will this bad html work?
Ultra Talker

Posts: 358
Location: Devon, UK
Trades: 4
I have been looking at some software and for some reason I cannot add "'s to a place where I need to add a link. I have tried it with bad html and it works alright in Firefox, just wondering how it will work in all browsers and what the impact would be...

PHP Code:
<a href=http://www.site.com/page.php target=_blank>this is a link</a> 
So, it's the same as a normal link except the "'s have been left out. As I said, it seems to work fine.

Otherwise anyone have any idea how I can get the program (in php) to recognise the "'s. It seems to replace them all with /'s if thats any help!

TIA
Simon
recedo is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-16-2005, 03:51 PM
funkdaddu's Avatar
Web Design Snob

Posts: 635
Trades: 0
Depending on the doctype it can kill the whole page on some browsers. To use quotes in a string in php, just put a \ before the quote:

echo "George \"The Animal\" Steele";
funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Old 12-16-2005, 04:04 PM
Ultra Talker

Posts: 358
Location: Devon, UK
Trades: 4
I have tried saving it like this;

PHP Code:
<a href=\"http://www.site.com/page.php\" target=\"_blank\">this is a link</a> 
and

PHP Code:
<a href=/"http://www.site.com/page.php/" target=/"_blank/">this is a link</a
But both of these just keep the / or \ and replace the " with another one!

This looks like it's going to be something that I'll need access to the code for doesn't it???? Unfortunatly I don't think I can get t it!

Thanks
Simon
recedo is offline
Reply With Quote
View Public Profile
 
Old 12-16-2005, 04:59 PM
funkdaddu's Avatar
Web Design Snob

Posts: 635
Trades: 0
Use backslash (below the delete/backspace key) NOT a forward slash (next to the shift key).

echo "<a href=\"http://www.site.com/page.php\" target=\"_blank\">this is a link</a>";

Your first example would work, except you forgot to escape the first " as well.
funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Old 12-16-2005, 05:06 PM
Ultra Talker

Posts: 358
Location: Devon, UK
Trades: 4
As I said I have tried both and they just replace the " with a / and keep the other \'s!

I'll have to try to get to the code to sort this one I think!

Simon
recedo is offline
Reply With Quote
View Public Profile
 
Old 12-17-2005, 12:36 AM
funkdaddu's Avatar
Web Design Snob

Posts: 635
Trades: 0
There must be something else - a server setting perhaps? Try asking in the PHP forum... I run that code from a php script on my machine and it runs fine...
funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Old 12-17-2005, 07:13 AM
Ultra Talker

Posts: 358
Location: Devon, UK
Trades: 4
okay, thanks for the advice I'll look into it.

By the way this code is not actually in a script, it's being saved to the database then called and displayed by the script. Not sure if I made that clear.

Simon
recedo is offline
Reply With Quote
View Public Profile
 
Old 12-17-2005, 07:52 PM
Ultra Talker

Posts: 253
Trades: 0
try this. <A HREF='http://yoursitehere'> Text </A> it should work , its dif. on php codes, etc. it will give you an error with quotes, lemme know if it works.
takita is offline
Reply With Quote
View Public Profile
 
Old 12-18-2005, 05:50 AM
the12thplaya's Avatar
Experienced Talker

Posts: 38
Trades: 0
Another thing to try in PHP is using " in your echo sctring. ie:

echo "<a href="http://www.site.com/page.php" target="_blank">this is a link</a>";

This has worked for me when storing and reading " in the databases. For more character conversions, check out this table:

http://www.lookuptables.com/
the12thplaya is offline
Reply With Quote
View Public Profile Visit the12thplaya's homepage!
 
Old 12-18-2005, 05:52 AM
the12thplaya's Avatar
Experienced Talker

Posts: 38
Trades: 0
Oops it showed up as quotes, this is what I mean't:

echo "<a href=& #34;http://www.site.com/page.php& #34; target=& #34;_blank& #34;>this is a link</a>";

Remove the spaces between & #34;
the12thplaya is offline
Reply With Quote
View Public Profile Visit the12thplaya's homepage!
 
Old 12-18-2005, 06:33 AM
madkad's Avatar
madkad-hosting.com

Posts: 310
Location: UK
Trades: 0
OK if your doing it in a php section of code this is it

PHP Code:
<?php
 
echo "<a href=\"http://www.site.com/page.php\" target=\"_blank\">this is a link</a>";
 
?>
remember this when you have a

PHP Code:

like

PHP Code:
<table border="1" celpadding="2" celspacing="3" width="100%"
it needs to look like

PHP Code:
<table border=\"1\" celpadding=\"2\" celspacing=\"3\" width=\"100%\"> 
so allways add \ before a "

also if you are doding it in php you need

PHP Code:
echo"<table border=\"1\" celpadding=\"2\" celspacing=\"3\" width=\"100%\">"
that will do one line so to get the HTML code to print nice in the source code this is what you need

PHP Code:
<?php
 
echo "<table>\n";
echo 
"<tr>\n";
echo 
"<td>hi</td>\n";
echo 
"</tr>\n";
echo 
"</table>\n";
?>
so thats \n"; at the end this makes a new line and will give you th8is in the HTML source code

HTML Code:
<table>
<tr>
<td>hi</td>
</tr>
</table>
with out the \n";

you will get

HTML Code:
 <table><tr><td>hi</td></tr></table>
LOL well i hope that helps
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Great Hosting For You
madkad is offline
Reply With Quote
View Public Profile Visit madkad's homepage!
 
Old 12-18-2005, 07:11 AM
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Trades: 0
Personally I think it's a problem with whatever PHP script it is you're using. It looks like it's escaping your "'s for you, (most likely so as not to cause string concatination problems with an SQL Statement) and then not un-escaping them when it displays the output.

Someone in the PHP Forum should be able to help you modify the script to un-escape \s into "
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Old 12-18-2005, 08:51 AM
Ultra Talker

Posts: 358
Location: Devon, UK
Trades: 4
Right guys, thanks for all the help.

I have to say AGAIN, that I'm not actually doing anything with the code! Where I am entering the link is in a text box that is saved into the database and when it's called thats the problem, so entering the php link code like you say (and I already knew and have tried) will not work.

I thought the "& #34;" method would work after reading it, but it still doesn't work correctly.

I know that the problem lies in the script but at the moment I don't have access to the script so I was looking for a workaround.

This post really started as a 'debate' about what impact the bad html would have, if only used in one place, i.e. entering the link without using " s, the link works fine in firefox.

Anyway, again thanks for your advice, if anyone has any more ideas for a possible work around please let me know! Otherwise I'm trying to get hold of the support team, the thing is I do not own the script and have been trying it out on their demo, I do not want to buy it unless I know this'll work! Maybe I should have pointed that out to begin with!

Cheers guys
Simon
recedo is offline
Reply With Quote
View Public Profile
 
Old 12-18-2005, 11:55 AM
funkdaddu's Avatar
Web Design Snob

Posts: 635
Trades: 0
Oh, well that's a different story if you're entering it into a DB because how the table you're entering it into is formatted (what type) can make a difference in how it's read in and out, as well as it being URL encoded and stuck into a line of SQL code . One solution is to try changing the "type" of field it's being entered into the DB, I know there's a short text field and a longer one, as well as a "memo" field in Access DBs, and there is something similar in MySQL.

I'm not 100% sure, as I deal more with MS DBs and not PHP-MySQl DBs, but you may just need to double up your quotes ("" for each ", I know that's how it's done on the MS side of things). Someone that does MySQL DBs more would have a better suggestion.
funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Old 12-23-2005, 07:41 AM
Ultra Talker

Posts: 358
Location: Devon, UK
Trades: 4
Thanks for your help. I've actually ended up having to use another script anyway, due to various restrictions with this one, and it's no longer a problem!

Thanks again
Simon
recedo is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to how will this bad html work?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.46326 seconds with 12 queries