Jump to content

DeanWhitehouse

Members
  • Posts

    2,527
  • Joined

  • Last visited

Everything posted by DeanWhitehouse

  1. as i said $list['0'] is wong, you should enter a table row like $list['row']
  2. erm, you could remove the href from it, after they click it , but the page would need to be reloaded.
  3. thanks, but i have just got it working ,there was an error in it. this is the code $code = eregi_replace("\+)\]([^\[]+)\[/url\]","<a href=\"\\1\" target=\"_blank\">\\2</a>",$code);
  4. i am lost of why it isn't working , try asking in the javascript forum
  5. then this won't work echo "<OPTION value='$line[0]'>$line[0]</OPTION>"; it should be $line['']; and one of these customerID surname forename addressLine1 addressLine2 postcode dailyNewspaper1 dailyNewspaper2 dailyNewspaper3
  6. <?php $oldstring = "[url=bob.php]bob[/url]"; $oldstring = eregi_replace("\[url=([^\[]+)\]([^\[]+)\][/url\]","<a href=\"\\1\" target=\"_blank\">\\2</a>", $oldstring); echo $oldstring; ?> this code is not doing anything, i don't know why it doesnt work, when i echo it it just says bob, anyone any ideas or can someone convert to preg_replace if need be?
  7. ok, i will show you how to get the value from the field and display it underneath without reloading. <script type="text/javascript"> function current() { //get the value from the text field var current = document.getElementById("current").value; //print to the div document.getElementById("preview").innerHTML = current; } </script> <input type="text" onKeyup="current()" id="current"/> <div id="preview"></div>
  8. javascript, if you want help with the code i am free to help
  9. try debugging , echo all the variables, and post your new code here
  10. soz, don't want to start another thread again. Is there anyway i can get the what is wrote after the eqauls sign, i am making bbcode and need it for link etc. e.g. [ link = ]Cake[ /link] this is my code so far <?php function bbcode($code) { //colors, links, images,email,quotes,block //marquee $code = preg_replace("/\[scroll\](.*?)\[\/scroll\]/","<marquee>\\1</marquee>",$code); //user $code = preg_replace("/\[user\](.*?)\[\/user\]/","<a href=''>\\1</a>",$code); //strong $code = preg_replace("/\[strong\](.*?)\[\/strong\]/","<strong>\\1</strong>",$code); //definition list $code = preg_replace("/\[dlist\](.*?)\[\/dlist\]/","<dl>\\1</dl>",$code); //term $code = preg_replace("/\[term\](.*?)\[\/term\]/","<dt>\\1</dt>",$code); //definition $code = preg_replace("/\[def\](.*?)\[\/def\]/","<dd>\\1</dd>",$code); //unorganized list $code = preg_replace("/\[ulist\](.*?)\[\/ulist\]/","<ul>\\1</ul>",$code); //organized list $code = preg_replace("/\[olist\](.*?)\[\/olist\]/","<ol>\\1</ol>",$code); //list item $code = preg_replace("/\[item\](.*?)\[\/item\]/","<li>\\1</li>",$code); //sub $code = preg_replace("/\[sup\](.*?)\[\/sup\]/","<sup>\\1</sup>",$code); //super $code = preg_replace("/\[sub\](.*?)\[\/sub\]/","<sub>\\1</sub>",$code); //pre $code = preg_replace("/\[pre\](.*?)\[\/pre\]/","<pre>\\1</pre>",$code); //emphazied $code = preg_replace("/\[em\](.*?)\[\/em\]/","<em>\\1</em>",$code); //italic $code = preg_replace("/\[i\](.*?)\[\/i\]/","<i>\\1</i>",$code); //strikethrough $code = preg_replace("/\[s\](.*?)\[\/s\]/","<del>\\1</del>",$code); //bold $code = preg_replace("/\[b\](.*?)\[\/b\]/","<b>\\1</b>",$code); $code = preg_replace("/\<b\>(.*?)\<\/b\>/","<b>\\1</b>",$code); //center $code = preg_replace("/\[center\](.*?)\[\/center\]/","<center>\\1</center>",$code); echo $code; } bbcode("[scroll]scroll[/scroll]<br/>"); bbcode(" [center]center[/center] <br/>"); bbcode("[b]Bold[/b]<br/>"); bbcode("[s]Strikout[/s]<br/>"); bbcode("[i]Italic[/i]<br/>"); bbcode("[em]Emphazied[/em]<br/>"); bbcode("[pre]Pre[/pre]<br/>"); bbcode("[sup]Super[/sup]<br/>"); bbcode("[sub]Sub[/sub]<br/>"); bbcode("[ulist][item]Unorganized list[/item][/ulist]<br/>"); bbcode("[olist][item]Organized[/item][item]list[/item][/olist]<br/>"); bbcode("[dlist][term]Term[/term][def]Definition[/def][/dlist]<br/>"); bbcode("[strong]Strong[/strong]<br/>"); bbcode("[user]User[/user]<br/>"); ?> <script type="text/javascript"> function preview() { var current = document.getElementById("current").value; document.getElementById("preview").innerHTML = current; } function insert(start,end) { var current = document.getElementById("current").value; var code = prompt("Enter Value for "+start+end+" tags"); if (code!=null && code!="") { document.getElementById("current").value += start+code+end; } else if(code == "") { document.getElementById("current").value += start+end; } } </script> <textarea id="current" onKeyUp="preview();" rows="10" cols="50"></textarea><br/> <span onClick="insert('[b]','[/b]')" style="cursor:pointer;"> Bold </span><span style="cursor:pointer;" onClick="insert('[i]','[/i]')"> Italic </span><span style="cursor:pointer;" onClick="insert('[s]','[/s]')"> Strikeout </span> <div id="preview"></div>
  11. it;s ok solved it now, here's my code if u want it <script type="text/javascript"> function preview() { var current = document.getElementById("current").value; document.getElementById("preview").innerHTML = current; } function insert(code) { var current = document.getElementById("current").value; document.getElementById("current").value += code; } </script> <textarea id="current" onKeyUp="preview();" rows="10" cols="50"></textarea><br/> <span onClick="insert('[b][/b]')" style="cursor:pointer;"> Bold </span><span style="cursor:pointer;" onClick="insert('[i][/i]')"> Italic </span><span style="cursor:pointer;" onClick="insert('[s][/s]')"> Strikeout </span> <div id="preview"></div>
  12. I have this code to add bbcode into a textarea <script type="text/javascript"> function preview() { var current = document.getElementById("current").value; document.getElementById("preview").innerHTML = current; } function insert(code) { var current = document.getElementById("current").value; document.getElementById("current").innerHTML = current+code; } </script> <textarea onKeyUp="preview();" id="current" rows="10" cols="50"></textarea><br/> <span onClick="insert('[b][/b]')" style="cursor:pointer;"> Bold </span><span style="cursor:pointer;" onClick="insert('[i][/i]')"> Italic </span><span style="cursor:pointer;" onClick="insert('[s][/s]')"> Strikeout </span> <div id="preview"></div> but the code isn't added if i have entered anything into the textarea, if it is empty then it adds the code fine, but if it isn't it doesnt do anything.
  13. i don't want to make a new thread, so here it is in my bbcode i want to allow certain html to be allowed, 2 things, is this an ok thing to do or should i totally disble it and how would i limit it to only allowing certain html to be in the string e.g. <center>
  14. ok, first off try header("Location:/admin/admin.php"); if that doesnt redirect try using an abosulte url, also are u getting any errors if not turn error reporting on error_reporting(E_ALL);
  15. so u want it to show an error if the password is wrong?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.