-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
dude il teach u everything u need to know about every language, when u need it, u go on teh internet and type in language name PROCESS instantiation, or language name Class definition or language name array manipulation thats it all the other bits are icing on the cake, oh and HTTP request What the ..? You're full of some right crap.
-
[SOLVED] How Can I Detect if a User's Cookies are Disabled?
Adam replied to Fluoresce's topic in Miscellaneous
Daym! Yeah seems so. I think the only way you could do it then would be to redirect the user after setting the cookie, and check for it there.. -
Me thinks wrong forum for this. What kind of assistance are you after?
-
You've not clearly explained what it is you're trying to do at all. Try giving examples of user input, the matching row of data, and what you expect outputted; then you'll probably get some decent help.
-
[SOLVED] How Can I Detect if a User's Cookies are Disabled?
Adam replied to Fluoresce's topic in Miscellaneous
I think he's thinking of something like... setcookie('cookie_test', 1, 1); if (isset($_COOKIE['cookie_test'])) { // cookies enabled } else { // cookies disabled } -
I'm pretty sure that must be illegal without proper notification. I'd check the emails they sent you and make sure there was no instruction at the bottom or anything saying to reply back if this is incorrect. I still wouldn't have thought this would be a legal procedure; what if you were away, sick, or something else and couldn't make it to the computer for a few days?
-
[SOLVED] How Can I Detect if a User's Cookies are Disabled?
Adam replied to Fluoresce's topic in Miscellaneous
You don't have to use PHP, almost any web programming/scripting language should have the ability to manipulate cookies, including JavaScript. Of course if they have cookies disabled, I would have thought they'd more like the kind of user to have JS disabled as well. In addition to that tutorial you may want to take a look at the PHP manual for setcookie, for a more thorough explanation. -
That is selecting fields...
-
This is just basic SQL? select name, points from table_name where username = 'blah blah'
-
Connecting MS Access to MySQL DB without using ODBC?
Adam replied to kevgais's topic in Miscellaneous
Define "connect the 2 databases"... -
[SOLVED] how to get values from $_Post with onchange="form.submit();"?
Adam replied to StefanRSA's topic in PHP Coding Help
That's because you have no input named "submit". The following would work: if (isset($_FILES['img1'])) { -
You cannot upload a 'directory' of images, but you can provide a way to upload multiple images and there are many many tutorials out there for that. http://www.google.co.uk/search?q=php+upload+multiple+images
-
[SOLVED] remove [square brackets and contents] from string
Adam replied to andyd34's topic in Regex Help
If you go back and read it all you'll see I changed the reg exp to: echo preg_replace('#\[.*?\]#', '', 'fri[hello]day'); S'plain how that doesn't work? -
You mean each user can save in some fashion, which or both of the 2 rows they'd like to be made visible when someone enters their user ID?
-
[SOLVED] update the selected existing records of database
Adam replied to nehrav's topic in PHP Coding Help
No problem... And it's bottom left whilst you're viewing the thread. -
[SOLVED] update the selected existing records of database
Adam replied to nehrav's topic in PHP Coding Help
You only need: if (isset($_GET['ids'])) { foreach ($_GET['ids'] as $key => $id) { $new_location = $_GET['new_locations'][$key]; $uaction = mysql_query("UPDATE test_tbl SET location='".$new_location."' where id='".$id."'"); if ($uaction) { echo "<tr><td>Successfully Updated</td></tr>"; } else { echo "<tr><td>Updation Failed</td></tr>"; } } } Remove the other parts. Although you should know by using if ($uaction) { .. you are only testing whether or not the query was successful - it may not have actually updated a row(s). You can use mysql_affected_rows to check the number of rows updated/inserted/etc. for a more accurate output. -
[SOLVED] update the selected existing records of database
Adam replied to nehrav's topic in PHP Coding Help
Could you show the full code as you have it now? -
[SOLVED] update the selected existing records of database
Adam replied to nehrav's topic in PHP Coding Help
I only showed you that code to give you a push in the right direction, not to use it literally. Sorry I might not have been very clear before. I think you're actually over complicating things. Once you have your inputs as arrays (I'm assuming they are called ids[] and new_locations[]) all you need to do is something like this: foreach ($_GET['ids'] as $key => $id) { $new_location = $_GET['new_locations'][$key]; $update = mysql_query("update your_table set location='".$new_location."' where id='".$id."'"); } Of course you'll need to add in some filtering and security, but, do you understand what I mean? -
[SOLVED] update the selected existing records of database
Adam replied to nehrav's topic in PHP Coding Help
Perhaps this will help... foreach ($_GET['ids'] as $key => $id) { echo $_GET['new_locations'][$key]; } Remember though you need to send the "new_location" as an array. To match the example above: <input type='text' name='new_locations[]' value='$location' size='45' maxlength='50'> -
You say "compare", but the in_array function is used to check if a string exists within an array. Can you be a little more specific with what you're trying to do?
-
[SOLVED] update the selected existing records of database
Adam replied to nehrav's topic in PHP Coding Help
By the way you'll want to look into the foreach $key / $k value in order select the same index from the other input arrays. -
[SOLVED] update the selected existing records of database
Adam replied to nehrav's topic in PHP Coding Help
That's because you have the same problem with the other inputs, the last value selected is over-writing the input value. You need to send all the other inputs as arrays too...