IIIce Posted April 16, 2012 Share Posted April 16, 2012 Hi guys! new to forum and to coding. I have poured over the forums and lots of places for an answer. I am not sure if this is due to my thus far limited understanding or, nto a specific enough question was asked. Basically it was suggested to me to make a link on a site from this: Search our Catalog: It was asked that I tie a link to that text and make it sort of a button so that when clicked, it takes someone to our catalog. The site is built with Drupal 6 and uses Danland theme and and a WYSIWYG. WHen I open the gear to edit this section I see: "<P align=right><a href="https://catalog.ncpl.lib.oh.us/polaris/logon.aspx"> Access Library Account</a> - <a href="https://catalog.ncpl.lib.oh.us/polaris/patronaccount/selfregister.aspx?"> Get a Card</a> - <a href="http://catalog.ncpl.lib.oh.us/polaris/search/default.aspx">Search Catalog</a></P> <!-- // Start of Search form --> <script language="javascript"> String.prototype.trim = function() { return this.replace(/^\s*|\s*$/g,''); } function ProcessInput(e) { if (window.event) // IE keyNum = e.keyCode; else if (e.which) // Netscape/Firefox/Opera keyNum = e.which; if (keyNum == 13) { e.returnValue = false; e.cancelBubble = true; DoKeywordSearch('KW'); return false; } return true; } function DoKeywordSearch() { if (document.getElementById('textboxTerm').value.trim() != '') { var strURL = 'http://catalog.ncpl.lib.oh.us/polaris/search/searchresults.aspx?ctx=1.1033.0.0.1'; var strWindex = document.getElementById('Windex').value; var strTerm = escape(document.getElementById('textboxTerm').value); window.location = strURL + "&type=Keyword&limit=TOM=*&sort=PD_TI&Page=0&by=" + strWindex + "&term=" + strTerm; } else { alert('Please enter a search term'); document.getElementById('textboxTerm').focus(); } } </script> <noscript>JavaScript must be enabled for catalog!</noscript> <table border="0"> <tr> <td> <label for="search">Search our Catalog:</label> <input class="search" type=text id=textboxTerm size=30 onkeypress="return ProcessInput(event)" /> <select class="search" id="Windex"> <option value="KW" selected="selected"> Anywhere </option> <option value="SU"> Subject </option> <option value="TI"> Title </option> <option value="AU"> Author </option> <option value="KW&fic=1"> Fiction </option> <option value="KW&fic=0"> Nonfiction </option> </select> <input type="submit" class="button" value="Go!" name="submit" onclick="DoKeywordSearch()" /> </td> </tr> </table> <!--// End of Search form -->" My question is where would the code for the link go and is there a good resource i can use to figure out how to write it? Any help is greatly appreciated, thank you. Quote Link to comment https://forums.phpfreaks.com/topic/261065-making-a-link/ Share on other sites More sharing options...
QuickOldCar Posted April 16, 2012 Share Posted April 16, 2012 Going to try and explain easiest way i can. If is wrapped with double quotes, you must use single quotes within, or escape the double quote " with a backslash \" //same window echo "<a href='http://my-link.com/'>click me</a>"; echo "<br />"; echo "<a href=\"http://my-link.com/\">click me</a>"; echo "<br />"; //new window echo "<a href='http://my-link.com/' target='_blank'>click me</a>"; echo "<br />"; echo "<a href=\"http://my-link.com/\" target=\"_blank\">click me</a>"; Quote Link to comment https://forums.phpfreaks.com/topic/261065-making-a-link/#findComment-1337955 Share on other sites More sharing options...
IIIce Posted April 16, 2012 Author Share Posted April 16, 2012 Ok so in the click me I type what I want eg "Search our Catalog" and the link is the link to the catalog yes? Also where does that need to be placed? and thank you. Quote Link to comment https://forums.phpfreaks.com/topic/261065-making-a-link/#findComment-1337957 Share on other sites More sharing options...
QuickOldCar Posted April 17, 2012 Share Posted April 17, 2012 I see, well this particular page is the search script...the place you want to send them to. You would want to place a hyperlink somewhere other than this page, like in your index file, or within your sites main theme If sent your index file, or your themes main page, would be easier to see a good place. But you just need to place a link that looks exactly like this somewhere. if is not within php code <a href="http://catalog.ncpl.lib.oh.us/polaris/search/">Search our Catalog</a> if is within php code echo "<a href='http://catalog.ncpl.lib.oh.us/polaris/search/'>Search our Catalog</a>"; I do see a search link already there that leads to this address just called Search http://catalog.ncpl.lib.oh.us/polaris/search/default.aspx?ctx=3.1033.0.0.3&type=Default I guess would have to be more specific in where you would like the link to be added, because I already see a link there. Quote Link to comment https://forums.phpfreaks.com/topic/261065-making-a-link/#findComment-1337965 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.