wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
PHP uses a UNIX Time stamp which is the number of seconds passed since 1st Jan 1970 I use UNIX timestamps, by using the time() function to get the timestamp of now or use strtotime to convert a date format into a time stamp, eg 12/06/2006 (dd/mm/yyyy) into a UNIX timestamp which produces the follow: 1165363200 I generally use INT as the data type when storing timestamps in MySQL. However you can use a TIMESTAMP as the data type if you want to. Its up to you when creating your database schema.
-
Its to do with your rewriteRule. Its too "hungry" So what ever you put after your domain name, say you do http://mysite.com/somefile.somecrap mod_rewrite will kick in and go to index.php?somefile.somecrap You need to use a better regular expression. What URL parameters does index.php take?
-
If you use margin: 200px then its going to add a 200px margin on all sides and thus you get a gap when your use clear:both. Just apply the margin/padding to the side you want it on: margin-left: 200px Or float the left and right elements to the left then you don't need to worry about adding margins to position the element on the right. The elements will but-up-against each other.
-
null means empty/no value/nothing
-
php mail() not working for linux machine
wildteen88 replied to phpnewb999's topic in PHP Installation and Configuration
The SMTP option if for Windows only. If your are using a unix based OS then you need to use the sendmail_path option instead -
Not possible I'm afraid AFAIK to make subdirectories with mod_rewrite. As first you need to set-up the subdirectory. Then you can use mod_rewrite to redirect the user top the subdirectory.
-
Question about using "POST" and MySQL in PHP
wildteen88 replied to bluez34me's topic in PHP Coding Help
The problem is you're using single quotes. Variabled do not get parsed by PHP if they are in single quotes. You'll want to use double quotes instead. So you use this for the quiery variable: [code=php:0]$query="UPDATE `links` SET `name`=$name, `link`=$link WHERE `key`=$key LIMIT 1";[/code] Also note I suggest you read up on prevent sql injection attacks. As currently your query is prone to SQL Injection attacks which can cause havoc over your database/others databases too!! Never use raw user input always validate/verify user input! -
Something like this should do: [code]RewriteRule ^product/([0-9+)$ myscript?action=product&id=$2[/code]
-
Add '-_' (without the quotes) after 0-9 in the square brackets if you get a 500 error after doing that change, then you might need to use '\-_' instead.
-
To use MYSQL via commad line you need to change directory to the MySQL bin directory. You do something like this: [code]cd C:\mysql\bin\[/code] Then you can type mysql -u root and it should log you in to MySQL. If its doesnt then you'll need to add the -p paramter to it and then provide the password for the root user. If you dont get any think from the command then make sure MySQL is running, check your processes (Ctrl+Alt+Del click processes tab).
-
Use two backslashes instead: $separated = explode("\\", $word); if you use one backslash on its own PHP will think you;re escaping the closing double quote. Use two backslashes together (\\) prevents this.
-
You need to read up on creating your own functions if you are not understanding the code. Prehaps reading [url=http://dev.fyicenter.com/faq/php/php_function_definition.php]this[/url] may help yuou understand. if you follow what I said IN my previous post your function should work. However the following is what your code should be: [code]// we difine our function here // PHP will not run this function until we tell it to // $post is the paramter for the function. function emoticon($post) { // defines the emoticons $emoticonarray = array( ':)' => 'smile.gif', ':(' => 'sad.gif', ';)' => 'wink.gif', ':P' => 'tongue.gif', ':(' => 'cry.gif' ); foreach($emoticonarray as $emoticon => $img) { $search[] = $emoticon; $replace[] = '<img src="images/emotions/' . $img . '" alt="' . $emoticon . '" />'; } $post = str_replace($search, $replace, $post); return $post; } // We'll now tell PHP to run our emoticon function we defined above: // we'll pass $r['post'] as a paramter to the emoticon function. // The function will now converet any smilie symbols in to images $r['post'] = emoticon($r['post']);[/code]
-
I used to go there quiote often. But I dont visit forgetfoo that often now.
-
Thats just plain old HTML. All that code does is create a form with 1 input field and a submit button. When you press the submit button it'll submit the data in the input field to a file called filename.html. if you wnat PHP to record whats been submitted you'll wnat to change filename.html to filename.php instead. You place this code where you want the form to show up on your page.
-
How do I mod rewrite to another folder? [RESOLVED]
wildteen88 replied to AdRock's topic in Apache HTTP Server
Make sure you have index.php added to the DirectoryIndex directive in the httpd.conf file. -
Whats repoting that error? Apache? If its MYSQL it should be running on port 3306. POrt 80 can only be used once. It cannot be shared with other TCP/IP apps.
-
Which forum are ytou posting in. You might be triggering the IPS.
-
I've seen this before. Cant remeber where though, I think I either got of off digg.com or forgetfoo.com However if this is true the school is pretty lame! The IT guys at the school should surely know what PHP is.
-
[quote author=redbullmarky link=topic=112251.msg455515#msg455515 date=1161456029] the easiest, most exciting way to see the top of your house involves a case of beer and a stepladder. it's also up to date, too, as it's completely live. [/quote] lol!
-
If you want to use text to submit the form then do somthing like this: [code]<a href="#" onclick="document.formNameHere.submit">Submit form[/code] Make sure you give your form an name and change formNameHere to what you named your form as. Or if you only have 1 form on the page use form[0] instead
-
Yes it is possible. Search google for a bad word filter or something similar They are easy to make.
-
Right click and select View Source form the context menu. What do you get? Is that blank too? If it is then I would recommend you to turn on display_errors and turn error_reporting to E_ALL in the php.ini. When you made the changes restart the server and run the script again. This time if there is any errors PHP will display them. However i have ran your code and it works fine. Make sure you are initiating you class. To initiate the class add the following code after you defind the CFS class: [code=php:0]// call the CFS class $cfs = new CFS;[/code]
-
=> sets the key for an item in an array. For example the following code: [code=php:0]$prices = array('tires=>'100', 'oil'=>10);[/code] Sets up a variable called prices which stores an array which has two items tires and oil the string to the left of => operator setups up the key. The stuff after the => operators sets the value for the key. The key is what you use in the square brakets, eg: $prices['tires'] $proces['oil'] So tires holds the value of 100 and oil holds the value of 10 If you didnt have the => operator PHP will use a numeric key instead starting at zero for the first item, 1 for the secound, 2 for the third etc. Hope that helps.
-
That should work in both PHP4 and 5. Whats the problem?
-
You can use the street name, zip/postal code or town/city or even the co-ordanates etc, if google earth finds a match it'll start to zoom in to that location. It is really kool stuff. I must of spent about 5 hours straight on it when I first got it. The images you see wont be recent they'll most probably be at least acouple of years old, however google does tend to update the images though. For me when I go to my house the picture that was taken was about 4-5 years ago. As my road was being resurfaced then.