ldougherty
Members-
Posts
319 -
Joined
-
Last visited
Never
Everything posted by ldougherty
-
just remove the .com aspect then, the ([^/]+) states to include anything as $1 and then outputs it on the other side.
-
[SOLVED] how to make div the full height of the screen
ldougherty replied to M.O.S. Studios's topic in CSS Help
Set the left and right class to a particular pixel or percentage? I know you can set the div to be the entire page height just by saying height:100% -
[SOLVED] what does this snippet of code do?
ldougherty replied to chmpdog's topic in PHP Coding Help
indeed. http://us3.php.net/manual/en/language.operators.comparison.php $a != $b Not equal TRUE if $a is not equal to $b. $a <> $b Not equal TRUE if $a is not equal to $b. -
Try this.. Options +FollowSymlinks RewriteEngine on RewriteRule ^/([^/]+).com /result.php?section=$1 [NC] There is some real good information in http://corz.org/serv/tricks/htaccess2.php
-
or you could use substr $month = substr("$dateofbirth", 0, 2); $day = substr("$dateofbirth", 3, 2); $year = substr("$dateofbirth", 6, 4);
-
[SOLVED] what does this snippet of code do?
ldougherty replied to chmpdog's topic in PHP Coding Help
That would be an if statement comparing the values of $i and $eu stating if $i and $eu are not the same to do something which would be executed where you see //stuff http://us.php.net/manual/en/control-structures.if.php -
Parse error: syntax error, unexpected T_STRING Help!
ldougherty replied to neex1233's topic in PHP Coding Help
change $sql = "UPDATE users SET tokens=(tokens+$t) WHERE id=$id" to mysql_query("UPDATE users SET tokens=(tokens+$t) WHERE id=$id"); -
[SOLVED] Simple photo gallery - Next / Prev buttons...
ldougherty replied to jsschmitt's topic in PHP Coding Help
Your code does no checking to see if the image actually exists before displaying the previous/next buttons which is why you can navigate to images that don't exist. Try putting in something that checks to see if the value being processed falls within the index range before showing the navigation buttons. -
Indeed; should be file_exists http://us3.php.net/file_exists buy even beyond that the logic doesn't add up. (file_exist($file)) { } else { echo "<img src=\"$file\"> } You are essentially saying if the file exists do nothing, if the file does not exist then show the image which is the file which apparently doesn't exist?
-
assuming your input box sends the value of $query $swearwords = array("swearword", "badword", "anotherswearword", "anotherbadword"); if (in_array($query,$swearwords)) { echo "No swearing"; }
-
sorry, i meant to say include_path, not include_dir
-
I believe you can specify the character set that the user can input into the form using charset http://www.w3.org/TR/html401/interact/forms.html#adef-accept-charset http://htmlhelp.com/reference/html40/values.html#charsets The other half would be in setting the charset on the mailer script itself.
-
Instead of using ../ try using the full path to the file. If that still doesn't work then add the path in your include_dir setting in the php.ini
-
http://us2.php.net/manual/en/function.mysql-fetch-row.php You can use mysql_fetch_row to return a single row instead of an array. This is a good way to pull out individual values from the database. The other option would be to use mysql_fetch_array and then reference the array object. For example assume you return 10 items in the array and you want item 2 and 3 you would reference them as $name[2] and $name[3]
-
Create a Catchall Email Address That Adds To Database
ldougherty replied to hoopplaya4's topic in PHP Coding Help
catchalls are a bad idea, they are basically a trash can for spammers to send to. With that being said if I understand your correctly you want to update a database when an email is received. This could possibly be accomplished depending on the mail program that is receiving the message, how mail is being checked etc etc. If you were to write your own custom PHP script that acts as a web based mail client (difficult) you could add a call to make that database update but I don't see how it could be done using a pop3 client like Outlook. -
If you assign the variable inside the while loop you can use it anywhere on the page inside the PHP tags, or inside HTML by opening the php tag as <? echo $name ?>
-
I'm not sure I understand your question but here is an example of how you would loop through the results of a query. $result=mysql_query("SELECT * FROM mytable"); while ($row = mysql_fetch_array($result)) { $name = $row[name]; $email = $row; echo "name is $name and email is $email<br>"; } This assumes you have fields for name and email and would assign a value and output each through the loop until it reaches the end of the database.
-
The from field on the received message will look like whatever they input on the form itself, ie if I say Larry when you receive it the from field will say Larry. Are you saying they enter it appropriately but the form is turning it to gibberish?
-
Displaying a list of sorted files + oldest.
ldougherty replied to nikneven's topic in PHP Coding Help
I've found this code on another site and it works. <?php $i = 0; if ($handle = opendir('./')) { //specify path in opendir while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && !is_dir($file)) { $files[$i] = strtotime(date ("M d Y H:i:s", filemtime($file)))." $file"; $i++; } } closedir($handle); } //sorts from increasing(date) use arsort for decreasing(year) sort($files,SORT_NUMERIC); $i=0; foreach ($files as $index => $value) { $modified[$i] = substr($value,11)." was last modified: ".date ("F d Y H:i:s",substr($value,0,20)); $i++; } //prints result as array foreach ($modified as $val) { echo "$val<br>"; } ?> -
Do you mean it is a password protected folder? If so you can pass the information via URL such as http://login:password@siteaddress.com/folder/file
-
The fact that the time is good now does not mean the time was good when your script executed previously. A lot of Linux servers run cron scripts to keep the date/time up to date. It is most likely that your server time was off when the script ran but there is no way to know for sure.
-
You should change your images to use full paths rather than relative paths, this is the only way for them to display properly with the rewrite rule in place.
-
file() throwing fatal error: Allowed memory size of 33554432
ldougherty replied to jjk2's topic in PHP Coding Help
Hello, This is your PHP memory as defined in your php.ini as memory_limit You will need to adjust this value to something larger if you wish to read this text file.