CircularStopSign Posted September 4, 2006 Share Posted September 4, 2006 in PHP how do i echo something so it says the code for a link? i tried but it says unexpected '<' in line 89... :( Quote Link to comment https://forums.phpfreaks.com/topic/19640-echoing-link-code/ Share on other sites More sharing options...
Ifa Posted September 4, 2006 Share Posted September 4, 2006 echo '<a href="...">...</a>'; Quote Link to comment https://forums.phpfreaks.com/topic/19640-echoing-link-code/#findComment-85554 Share on other sites More sharing options...
radar Posted September 4, 2006 Share Posted September 4, 2006 Show me how you tried to do it and I'll tell you your problem... To echo a link this is how you would do it...[code]<?phpecho '<a href="what">what what</a>';?>[/code]if you have something different to do that -- id change it.. Quote Link to comment https://forums.phpfreaks.com/topic/19640-echoing-link-code/#findComment-85555 Share on other sites More sharing options...
CircularStopSign Posted September 4, 2006 Author Share Posted September 4, 2006 well i want it to echo so it says the actual code for the link, not just the unerlined link itself Quote Link to comment https://forums.phpfreaks.com/topic/19640-echoing-link-code/#findComment-85557 Share on other sites More sharing options...
radar Posted September 4, 2006 Share Posted September 4, 2006 ahh.. lemme do a test right quick... and i'll get back with you.. Quote Link to comment https://forums.phpfreaks.com/topic/19640-echoing-link-code/#findComment-85563 Share on other sites More sharing options...
CircularStopSign Posted September 4, 2006 Author Share Posted September 4, 2006 ok haha thanks Quote Link to comment https://forums.phpfreaks.com/topic/19640-echoing-link-code/#findComment-85564 Share on other sites More sharing options...
venkateshinbox Posted September 4, 2006 Share Posted September 4, 2006 How abt this one?$a = "<a href=abc.php>test</a>";echo $a; Quote Link to comment https://forums.phpfreaks.com/topic/19640-echoing-link-code/#findComment-85590 Share on other sites More sharing options...
radar Posted September 4, 2006 Share Posted September 4, 2006 Well since the syntax of the link itself is wrong -- it might work.. though if the syntax was right it wouldn't.. it would process the html.. see problem is gotta figure out how to make the html not process... Quote Link to comment https://forums.phpfreaks.com/topic/19640-echoing-link-code/#findComment-85593 Share on other sites More sharing options...
Jenk Posted September 4, 2006 Share Posted September 4, 2006 [code]<?php echo htmlentities('<a href="http://www.example.com/">link</a>'); ?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/19640-echoing-link-code/#findComment-85597 Share on other sites More sharing options...
radar Posted September 4, 2006 Share Posted September 4, 2006 ahh a new function.. havent seen this one before *heads to php.net for some reading* Quote Link to comment https://forums.phpfreaks.com/topic/19640-echoing-link-code/#findComment-85598 Share on other sites More sharing options...
CircularStopSign Posted September 4, 2006 Author Share Posted September 4, 2006 alright guys, this is finally what iput down and it works. thanks guys[code]if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo htmlentities('<a href="http://www.hostmapics.com/"><img src="http://hostmapics.com/'); echo $target_path; echo htmlentities('"></a>');} else{ echo "There was an error uploading the file, please try again!";}[/code] Quote Link to comment https://forums.phpfreaks.com/topic/19640-echoing-link-code/#findComment-85750 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.