Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. Would you better of doing it in JavaScript rather than in PHP? Doing it in JavaScript will be easier to do and doesnt require page refreshes to show/hide a a code block on the page.
  2. Make sure sessionstartandsql.php is not outputting anything either. Otherwise the headers will fail to work and you'll either get a blank page or a headers already sent error message.
  3. Surely you can use Plesk to manage the email accounts for the mail server? For creating the form its just basic html to create the form. Then you use PHP to manage the uploaded file. There are plenty of tutorials all over the internet that show you how to upload files with PHP.
  4. Is the .inc file being included into a .php file? If it is then the PHP code in the .inc file should run. Also make sure you are using the full PHP code tags (<?php ?>) and not the short hand tags (<? ?> or <?= ?>).
  5. Then you will need to check that there are equal [nobbc][code][/nobbc] and [nobbc][/code][/nobbc] tags in the post. If there aren't then you will need to add in [nobbc][/code][/nobbc] to the end of the post and then parse the code tags.
  6. Chnage: [code=php:0]mysql_select_db("1167951294", $this->conn);[/code] to this: [code=php:0]mysql_select_db("1167951294", $conn);[/code] you should only use $this-> when in a class.
  7. looks like when you installed WAMP it didnt enable the mysql extension. To do so please read [url=http://www.phpfreaks.com/forums/index.php/topic,95378.0.html]this FAQ[/url]
  8. If you want to use the pg_* function set you need to load the postgreSQL extension in the php.ini. To do so just uncomment the following line in the php.ini: ;extension=php_pgsql.dll uncomment means remove the semi-colon ( at the start of the line. Once you've done that save the php.ini and restart XAMPP
  9. You cannot use mysql_* with the mysqli library you must use mysql[b][color=red]i[/color][/b]_* function set. Your code should be like this: [code=php:0]$conn = mysqli_connect('localhost', 'userone', 'password') or die  ('Error connecting to mysql'); echo "connection established";[/code] Also when you are bugging scripts make sure you turn on display_errors directive in the php.ini and that error_reporting is set to E_ALL aswell.
  10. Here use this instead: [code]<style type="text/css"> body{ background-color:#006699; color:#FFFFFF; font-family:Arial, Helvetica, sans-serif; font-size:12; } a:link{ color: #FFFFFF; text-decoration: underline; } a:visited{ text-decoration: underline; color: #CCCCCC; } a:hover{ text-decoration: none; color: #942C2C; } a:active{ text-decoration: underline; color: #999999; } </style> <script type="text/javascript"> function menu(obj,expd,clp) {     var element = document.getElementById(obj);     if(element.style.display != 'none') {     element.style.display = 'none';     document.getElementById(expd).style.display = 'inline';     document.getElementById(clp).style.display = 'none';     } else {         element.style.display = '';         document.getElementById(expd).style.display = 'none';         document.getElementById(clp).style.display = 'inline';     } } function code_select(obj) { var selection = window.getSelection(); var range = document.createRange(); range.selectNodeContents(document.getElementById(obj)); selection.removeAllRanges(); selection.addRange(range); } </script> <body> <?php $self = $_SERVER['PHP_SELF']; if(!isset($_POST['txt'])) {     $form ="<form method=\"post\" name=\"txt_check\" action=\"$self\">";     $form.="Enter Some Text: ";     $form .= "<textarea name=\"txt\"></textarea> ";     $form .= "<input type=\"submit\" value=\"Submit\" onSubmit=\"this.value='Submitting...';this.disabled='true';\"/><br>"; echo $form; } else {     $msg = $_POST['txt'];     $bbsearch = array( '/\[b\](.*?)\[\/b\]/is',                       '/\[i\](.*?)\[\/i\]/is',                       '/\[u\](.*?)\[\/u\]/is',                       '/\[s\](.*?)\[\/s\]/is',                       '/\[blink\](.*?)\[\/blink\]/is',                       '/\[url\](.*?)\[\/url\]/is',                       '/\[email\](.*?)\[\/email\]/is',                       '/\[url\=(.*?)\](.*?)\[\/url\]/is',                       '/\[email\=(.*?)\](.*?)\[\/email\]/is',                       '/\[img\](.*?)\[\/img\]/is',                       '/\[color\=(.*?)\](.*?)\[\/color\]/is',                       '/\[size=xx-small\](.*?)\[\/size\]/is',                       '/\[size=x-small\](.*?)\[\/size\]/is',                       '/\[size=small\](.*?)\[\/size\]/is',                       '/\[size=medium\](.*?)\[\/size\]/is',                       '/\[size=large\](.*?)\[\/size\]/is',                       '/\[size=x-large\](.*?)\[\/size\]/is',                       '/\[size=xx-large\](.*?)\[\/size\]/is',                       '/\[align=left\](.*?)\[\/align\]/is',                       '/\[align=center\](.*?)\[\/align\]/is',                       '/\[align=right\](.*?)\[\/align\]/is',                       '/\[align=justified\](.*?)\[\/align\]/is');     $bbreplace = array( '<b>$1</b>',                         '<i>$1</i>',                         '<u>$1</u>',                         '<s>$1</s>',                         '<blink>$1</blink>',                         '<a href="$1" target="_blank">$1</a>',                         '<a href="mailto:$1">$1</a>',                         '<a href="$1" target="_blank">$2</a>',                         '<a href="mailto:$1">$2</a>',                         '<img src="$1" border="0"/>',         '<span style="color:$1;">$2</span>',                         '<span style="font-size: xx-small;">$1</span>',         '<span style="font-size: x-small;">$1</span>',         '<span style="font-size: small;">$1</span>',         '<span style="font-size: medium;">$1</span>',         '<span style="font-size: large;">$1</span>',         '<span style="font-size: x-large;">$1</span>',         '<span style="font-size: xx-large;">$1</span>',                         '<div style="text-align: left;">$1</div>',                         '<div style="text-align: center;">$1</div>',                         '<div style="text-align: right;">$1</div>',         '<div style="text-align: justified;">$1</div>'                       );     function makeCodeBox($code, $cID)     {         $code = str_replace(array("[", "]"), array("&#91", "&#93"), $code);         $html = <<<HTML <div style="border:1px solid #000000;display:table;width:350;margin:0px auto;">   <div style="background-image:url(code_top.png);background-repeat:repeat-x;">     <a href="javascript:menu('code{$cID}','expand{$cID}','collapse{$cID}');" title="Show Or Hide This Code">       <span id="expand{$cID}" style="display:none;"><img src="expand.gif" width="9" height="9" alt="[-]" border="0"/></span>       <span id="collapse{$cID}" display="inline"><img src="collapse.gif" width="9" height="9" alt="[-]" border="0"/></span>     </a>     Code :: <a href="javascript:code_select('code{$cID}');" title="Highlight The Code">Select Code</a>   </div>   <div id="code{$cID}">     <div style="background-color:#000000;height:1px;width:100%;font-size:0;"></div> <div style="background-color:#5A2323;height:1px;width:100%;font-size:0;"></div> <div style="background-color:#470A0A;"><code>{$code}</code></div>   </div> </div> HTML;         return $html;     } $msg = htmlentities($msg); $msg = stripslashes($msg); $msg = nl2br($msg); $i = 0; while(preg_match("/\[code\](.*?)\[\/code\]/ise", $msg, $matches)) { $i++; $msg = str_replace($matches[0], makeCodeBox($matches[1], $i), $msg); } $msg = preg_replace($bbsearch, $bbreplace, $msg); echo "Why Did You Write $msg?"; } ?>[/code]
  11. Go to FCKEditors website and click the Support link then documentation link. Which will take to the [url=http://wiki.fckeditor.net/]wiki[/url] got all you need in there.
  12. [quote author=paul_ link=topic=124600.msg516610#msg516610 date=1170114680] [quote author=fert link=topic=124600.msg516583#msg516583 date=1170113718] I believe php also requires libmysql.dll [/quote] Its working now but libmysql.dll was not required. Thanks for everyones answers they were great :D [/quote] PHP most probably found another one somewhere else then. Most probably the libmysql.dll in the MySQL bin directory.
  13. Most webhosts don't allow access to the php.ini so you wont be able to edit it. Does the hosting account you are on with Yahoo allow to use SMTP/Sendmail?
  14. Browsers do not understand PHP code. PHP is a server side programming langauge. Not client side (HTML, CSS, JavaScript are client side and browsers understand these). What you'll want to do is download a package called WAMP. Once you have this installed you can view page with PHP code in them - in order to do that you need to store these files in WAMP's www folder (C:\WAMP\www) and then you go to http://locaalhost/ to run them.
  15. The problem is with db.php: [code=db.php]<?php $db = mysql_connect("free-mysql.BizHostNet.com:3306", "1167951294", "MYPASSWORD" mysql_select_db("1167951294", $this->conn) ?>[/code] Your code has a few majour issues. Which are you havn't closed the mysql_connect function and the secound you are not ending your lines with semi-colons. This is how you code should be: [code]<?php $db = mysql_connect("free-mysql.BizHostNet.com:3306", "1167951294", "MYPASSWORD"); mysql_select_db("1167951294", $this->conn); ?>[/code] Also this is not an installation issue either. Moving to PHP Hep forum.
  16. Change the theme to the default phpMyAdmin theme. Looks like the theme you are using is corrupt or is not compatible. Other than that I'm not sure what to suggest.
  17. Oh pants! I left out a closing [b])[/b]  on the if statement. Change this: [code]if(isset($_POST['txt']) {[/code] to this: [code]if(isset($_POST['txt'])) {[/code] It should be fine now *crosses figures*
  18. cc96ai is correct you can only use the php_value or php_flag or any of the other php_* directives in a .htaccess if PHP is loaded as an Apache Module.
  19. Yeah that is correct file you're downloading. For getting extension you will want to download the PECL ones - http://pecl.php.net/ You don't need PEAR for that you just download the .dll files
  20. You're best of reading the PEAR documentation found over at [url=http://pear.php.net]pear.php.net[/url]
  21. I have no idea how IIS works. So I cant really help you sorry. However I what I can do is send you to the manual on configuring IIS. [url=http://www.php.net/manual/en/install.windows.iis.php]clicky[/url]
  22. Because PHP is not a client side langauge. It is a server side language. If you ran a  PHP file through a browser the browser wont understand what the code is. So it either ignores it or shows it (some browsers vary). When you go to http://localhost/ you are accessing the local server (apache). So now when you request a PHP file from the server, it recognises that and passes it to PHP. PHP then processes the code in the file. Once processed it sends the output of the code back to Apache. Apache then sends that output from PHP to the browser. The browser now knows what to do with output.
  23. I am not experienced with PEAR, so i may be wrong, but you use PEAR to install extra libraries from PECL, PEAR and user submitted libraries/extension. Yes it downloads them from the net (pear.php.net). So if your laptop is not connected to the net then don't use PEAR unless you download the packages manually onto a PC/laptop that is connected and then transfer the libraries/extensions you downloaded on to your laptop and the run PEAR to install them.
  24. Pear comes with PHP, yes. However it needs to be installed. If I remember you need to run the pear.bat file it should then ask you a few questions and start to install itself. Then using PEAR you can download PECL libraries
  25. [quote author=bogdan link=topic=124579.msg516379#msg516379 date=1170102880] Maybe it seems to be OK, but when I test it, it says that the mail can't be sent, and it ask me to check the server. I have a SMTP server that I can use, but I don't know where to add the datas. [/quote] It might be PHPs configuration. If you can edit PHP's config (php.ini) then you'll need to edit the following lines [code][mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 ; For Win32 only. sendmail_from = y[/code]
×
×
  • 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.