ignace
Moderators-
Posts
6,457 -
Joined
-
Last visited
-
Days Won
26
Everything posted by ignace
-
upon registration: INSERT INTO members SET registered_date = now(), ip_address = $_SERVER['REMOTE_ADDR'] upon login: UPDATE members SET last_login_date = now(), ip_address = $_SERVER['REMOTE_ADDR'] WHERE id = $id
-
[SOLVED] Tying a DB to files that exist only in a directory
ignace replied to rondog's topic in PHP Coding Help
create a .txt for each file on which they comment (create a file only once their is an actual comment) When you display a file look for a .txt with the same name and load it. -
Assigning/arranging relational numbers to an array
ignace replied to blargalarg's topic in PHP Coding Help
Why make it so hard? You can keep it as simple as it just is (this requires javascript for the drag-and-drop). I roll out (using PHP): <ul> <li><a href="http://link1">mylink #{$pos}</a> <input type="hidden" name="links[]"></li> <li><a href="http://link2">mylink #{$pos}</a> <input type="hidden" name="links[]"></li> <li><a href="http://link3">mylink #{$pos}</a> <input type="hidden" name="links[]"></li> <li><a href="http://link4">mylink #{$pos}</a> <input type="hidden" name="links[]"></li> <li><a href="http://link5">mylink #{$pos}</a> <input type="hidden" name="links[]"></li> </ul> Then the user modifies these by dragging and dropping them into the new order: <ul> <li><a href="http://link1">mylink #{$pos}</a> <input type="hidden" name="links[]" value="{$id}"></li> <li><a href="http://link3">mylink #{$pos}</a> <input type="hidden" name="links[]" value="{$id}"></li> <li><a href="http://link4">mylink #{$pos}</a> <input type="hidden" name="links[]" value="{$id}"></li> <li><a href="http://link2">mylink #{$pos}</a> <input type="hidden" name="links[]" value="{$id}"></li> <li><a href="http://link5">mylink #{$pos}</a> <input type="hidden" name="links[]" value="{$id}"></li> </ul> Then I use: $links = $_POST['links']; $sizeof = sizeof($links); for ($i = 0; $i < $sizeof; ++$i) { $id = $links[$i]; $query = "UPDATE links SET position = $i WHERE id = $id"; //.. } I roll out just like I did before: <ul> <li><a href="http://link1">mylink #{$pos}</a> <input type="hidden" name="links[]" value="{$id}"></li> <li><a href="http://link3">mylink #{$pos}</a> <input type="hidden" name="links[]" value="{$id}"></li> <li><a href="http://link4">mylink #{$pos}</a> <input type="hidden" name="links[]" value="{$id}"></li> <li><a href="http://link2">mylink #{$pos}</a> <input type="hidden" name="links[]" value="{$id}"></li> <li><a href="http://link5">mylink #{$pos}</a> <input type="hidden" name="links[]" value="{$id}"></li> </ul> The links in the new order. -
Yes there is have a look at transactions: http://dev.mysql.com/doc/refman/5.0/en/commit.html
-
<tr> <td class=\"header\">Name</td> <td class=\"header\">Title</td> <td class=\"header\">Email</td> </tr> perform stripslashes before you output it.
-
function my_stristr() { $matches = array(); if (2 <= func_num_args()) { $args = func_get_args(); $haystack = array_shift($args); $needles = $args; foreach ($needles as $needle) { $matches[$needle] = stristr($haystack, $needle); } } return $matches; } $matches = my_stristr($haystack, $needle1, $needle2, $needle3, $needle4);
-
Notice: Undefined index: select in C:\wamp\www\map\myform.php on line 13 Becuase you are missing select in your url http://domain/page.php?select=something Notice: Undefined variable: select in C:\wamp\www\map\index.php on line 28>UCLA (all along the dropdown menu). Because you need to add: $select = $_GET['select']; before: ($row_list['id'] == $select)
-
$_SESSION['username'] = $_POST['username'] for example
-
Except it was less error prone.
-
print '<a href="http://domain/page.php?user=' . $_SESSION['username'] . '">click</a>';
-
Have you got an SMTP installed? Then modify your SMTP settings in the php.ini
-
$parts = explode('-', $var); print $parts[1];
-
use re-captcha http://recaptcha.net/ as a captcha code. They give you detailed information in how to use their API http://recaptcha.net/plugins/php/
-
pass VARCHAR(16) to pass VARCHAR(32) register: INSERT INTO tbnlmembers VALUES(NULL, '$user', MD5('$pass'), '$fname', '$lname', '$email') login: SELECT * FROM tbnlmembers WHERE username = $username AND pass = MD5('$pass')
-
Want to create a search engine via criteria/check boxes.
ignace replied to kenetik's topic in Application Design
Could you provide an example? Or some code? -
Have you got an SMTP installed?
-
You can use ini_set('sendmail_from', $from); or the better option: $headers = "From: $from\r\nReply-To: $from\r\n";
-
UPDATE members SET passwd = $newpasswd WHERE member_id = $id Next time make some effort and read the mysql manual as what you are asking for is simple and is covered in each and every tutorial and php/mysql book.
-
Can't find the other article, sorry.
-
If you are looking for someone to write something for you then you should have posted in the freelance section.
-
Have you added the From: header?
-
OO has a reputation (if used in a correct fashion) for letting your code-base grow without that many headaches. But this may be not an option at the time as the application is already build and re-building is expensive. So I would advice to try to re-factor your current code-base.