wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
What errors do you get. Post them here in full. From what I can tell from your post you are getting permission errors. If you are then make sure the php nuke folder and subfolders within in it have the correct CHMOD settings which should be 755 and the files should have a permission of 644. Some files require you to set them to 666 too. Read this page for setting the correct CHMOD permission for php nukes files and folders.
-
You also have a missing semi-colon at the end of the color: #0000FF line
-
Look in to in_array function perhaps.
-
Yes. Note the quotes around ON, highlighted below: echo("확인 : <input type=checkbox name=reading checked value="ON"> "); This is intefering with the double quotes for the echo statement. PHP is thinking you are ending the echo when it gets the to double quote to the left ON. Then troughs an error saying unexpect T_STRING. Always use single quotes when you double quotes in strings. Or if you use double quotes to start of a string make sure you escape any double quotes within the string, example \". This applies to single quotes aswell. Use single quotes instead for your echo statement and lose the braces too. No need for them: echo '확인 : <input type="checkbox" name="reading" checked value="ON"> ';
-
There is a missing quote for last item in the bb-replace array. This is the correct code: $bb-replace = array('[b]','[/b]','[i]','[/i]'); Also note that you cannot use hyphens in array names. You can only use letters, numbers and underscores for variable names. No other characters are allowed. Change the hyphens (-) to underscores in stead. So the correct code: $string = "I am so [b]cool[/b] "; $bb_replace = array('[b]', '[/b]', '[i]', '[/i]'); $bb_replacements = array ('<b>', '</b>', '</i>', '</i>'); $string = str_replace($bb_replace, $bb_replacements, $string); echo $string;
-
$char is created form the foreach loop. It holds the value of each item in the array. Read up on foreach in order to understand what is going on. It basically holds the value of the item the array pointer is at. So on the first loop $char will hold '<' as the value, the second loop it will hold '>' and so on through out the array.
-
[SOLVED] firefox wants to download html file
wildteen88 replied to forzatio's topic in PHP Coding Help
Looks like a server configuration issue to me. Try clearing FF cache Shift+Ctrl+Del - detick every box except Cache. Click Ok. If the problem persists then the server is not configured correctly. -
If you have been running this script since you have had it surely you must have made a database backup? Did you old host give you any database backups?
-
Make sure you have enabled the mbstring extension in the php.ini For Windows: open the php.ini and remove the semi-colon ( infront of the following line: extension=php_mbstring.dll Also insure the extension_dir directive is set up too. It should be pointing to PHP 's extension folder, eg C:/PHP/ext Any changes you make to the php.ini save and restart your server (Apache, IIS or whaterver). For Unix (Mac, Linux etc) you will have to recompile PHP with the --enable-mbstring command whilst compiling. Read the manual on using Multibyte String Functions here - Scoll down to the Installation sub heading
-
If you want 10 images going down just use the img tag and after it a line break <br /> However you can use a list if you wish. Or wrap them in span (<span>img></span>) and give the span tags a bit of margin for the top and bottom to space the images out.
-
What jcombs was referring to about :hover only working for links in IE. Was that IE (6 and below) only supported it for anchor tags. M$ has finally got around to allowing :hover to work on any tag with the latest release of IE7.
-
HTTP_COOKIE_VARS is depreciated. Use $_COOKIE instead. This go for all the other HTTP_*_VARS variables. Example: $HTTP_POST_VARS should be $_POST $HTTP_GET_VARS should be $_GET ALso note that you cannot use and set cookies that where set on the same page. You will have to refresh the page in order for the cookie that you just set to come available. However if you are setting and using cookies on seperate pages then you dont need to refresh.
-
This is an Apache question not a PHP question. You cannot modify the HTML of those pages - AFAIK. However you can change the way Apache displays those pages by changing the autoIndex options. Mainly by changing the IndexOptions directive You can also attach a stylesheet so you can style the page by CSS. Check out this page for the options available to change the way directory indexes are displayed.
-
This is not the correct syntax: if ($row_Recordset3['access'] !== ('var1' || 'var2')){do something} YOu can not evaluate multiple values at one time you have to do each separately like so: if($row_Recordset3['access'] != 'Var1' || $row_Recordset3['access'] != 'Var2') { // either row_Recordset3['access'] does not equal to var1 or var2 } else { // either row_Recordset3['access'] does equal to var1 or var2 }
-
This can be handled by MySQL it self. Give your picture column a default value of nopreview.gif So when you insert the data into the database MySQL will place nopreview.gif as the value of the picture column if the picture column is given a null value. If you weant to do this method read up on creating tables with mysql and using the default option for columns. However you can do it with PHP as well by doing something like this: $pic = (isset($_FILES['photo']['name']) && !empty($_FILES['photo']['name'])) ? $_FILES['photo']['name'] : 'nopreview.gif'; It is not a complicated process to do what you are trying to do. It is just basic stuff with checking the value of variables. Then checking that variable is not empty if it is give it a value of nopreview.gif If we give you the code and tell exactly what to do you are not going to learn for yourself how to do it. If you want someone to do it for your then take a trip to the freelancing forum. I have given a few simple possibilities for what you are trying to do. Its now down to you to implement these into your app.
-
Oops! I did a typo there I meant I have not solved it not I have not solved Sorry to disappoint. I am looking at your script.
-
I know you solved this, by using the mysqli_connect function but the problem was you was using mysql_connect to connect to the MySQL server but you have the mysqli extension enabled. You cannot use the mysql function library (mysql_connect, mysql_query etc) with that extension. You must use the mysql improved (mysqli - mysqli_connect) function set. php_mysql.dll and php_mysqli.dll have different function sets.
-
I have solved it. As he/she has yet to be able to find out why his script is not converting the newlines. I ahve just simply did a bit of basic debugging to see if its the server that is at fault. But as my code is running as it should then I have assumed it must be something is his/her script that is not quite right. ALso by the way this post: accept-charset='iso-8859-1 <<<<<<<<<<, this is why try without it ok. No offence but makes no sense at all! At least provide an example and explain where its supposed to go. Rather than just posting a snippet and saying use that.
-
POst this in the correct forum first. If you want a PHP programmer to do something for you post in the PHP Freelancing forum.
-
OK so that works. There must be something in your code which escapes the newlines characters. Not sure what's up but I will have a look. @ redarrow No that was my code DanyalSakrani said worked.
-
Whats errors are you getting, what are you trying to do. What is supposed to happen and what is happing. Please provide more information. If you just provide code and no explanation then how are we supposed to help
-
You must give Apache sufficient configuration with the AllowOverride directive in order for Apache to abide by the configuration set forth in the .htaccess. If you don't have FileInfo listed in the AllowOverride directive then Apache will ignore .htaccess files.
-
Of course it will as you have edited it. However there is something that is escaping the newlines characters when you submit the form. Create a new script and put this in it: <?php if(isset($_POST['msg'])) { $msg = $_POST['msg']; echo 'Raw data: <pre>' .htmlentities($msg) . "</pre>\n"; echo "\n<hr />\n"; echo "Processed data:<br />\n" . nl2br($msg); echo "\n<hr />\n"; } ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> Message:<br /> <textarea name="msg" rows="10" cols="50"></textarea><br /> <input type="submit" name="submit" value="Post Message" /> </form> what does that produce?
-
Whn converting BBCode to HTML it is best to it when you go to show it to the user in your webpage rather than convert it to HTML first and then save it in the database. Then having to go through the trouble of converting the HTML to BBCode when you want to edit what was submitted. You should keep what ever is submitted in its raw form. When converting using regex dont do this: $input = array( "/\[b\]/", "/\[\/b\]/" ); Use the full of power of regex and do this: $input = array("/\[b\](.*?)\[\/b\]/is" ); That is much more better rather converting each closing/opening tag separately. The trick here is to use pattern modifiers notice the i and s after the closing the delimiter (/) those tell the PCRE engine to ignore newlines (allowing for the parsing to span multiple lines rather than one) and to be case insensitive so is the same as .
-
Do you know what the AllowOverride option is set to in the httpd.conf for the main <Directory /> area ( found around line 200 in the httpd.conf). It must have the following two options listed: FileInfo and Indexes or set to All in order for the configuration options in the .htaccess file to be applied otherwise Apache will just ignore what is set in the .htaccess file.