I am trying to make a little widget kind of...anyway, here is the actual widget so far: http://userbility.net/begin.php If you enter the detaisl it will grab the values and post them to the next page- end.php....oln end.php there is a button that says " click to get code" and I am trying to figure out how to make that iframe contain the source code for the user to copy/paste onto their site.... If you run through the steps you will see what I am talking about...how do I do this? In the end, they will click the "click to get code" and then it will show something like this in the iframe: My name is Sean and I am an alcoholic with <script> /* Count up from the date */ var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec") function countup(yr,m,d){ var today=new Date() var todayy=today.getYear() if (todayy < 1000) todayy+=1900 var todaym=today.getMonth() var todayd=today.getDate() var todaystring=montharray[todaym]+" "+todayd+", "+todayy var paststring=montharray[m-1]+" "+d+", "+yr var difference=(Math.round((Date.parse(todaystring)-Date.parse(paststring))/(24*60*60*1000))*1) difference+=" days" document.write("<strong>"+difference+"</strong> sober!") } //enter the count up date using the format year/month/day countup(2009,12,15) </script> Code (markup): I tried to make that whole block of code a variable and echo it and tried to just straight echo it right from the get go but I really can't figure this out as a am VERY VERY new to PHP. I will shorten the JS once I figure out how to get this part done...so it just echos back something like: <SCRIPT LANGUAGE="JavaScript" SRC="http://userbility.net/js/therefile1998.js"> ...but for now, I just have to figure this part out....lol
PS: Here is a example of kind of what I mean...i think this is jquery...but maybe someone has a different way besides javascript...i duno....i just really want to know how to do this: http://www.webuildpages.com/iframed...w.mayandoomwebsite.com'>MayanDoomsday.com</a> He just made a string on the end of the url that fills the variables i think but...im not quite sure how to do that
I don't really understand the question but you don't want the script executed but show the source code instead, right? I think you can just replace < with < and > with > and so on..