-
Posts
4,362 -
Joined
-
Last visited
-
Days Won
11
Everything posted by Zane
-
search multiple fields using multiple form elements
Zane replied to bickyz's topic in PHP Coding Help
You're missing a concatenation period in between WHERE " ... and join( You are seeing Hello Array because $_POST['activity'] is an array... as Barrand suggested you did. -
Posting announcements from one website to all our member sites
Zane replied to hummerton's topic in PHP Coding Help
You create an RSS feed that is fetched by your template. Otherwise, you would need DB, FTP, or SSH access to their servers which I doubt your members are going to entertain. -
Just strtolower() $filename foreach ($_FILES as $file) { $fileName = strtolower($file['name']);
-
If that is all you need it for then disregard my integrity statement.
-
If you only want 8 characters then use substr echo substr( md5("password"), 0, ; Keep in mind though, this will lower the integrity of your hashes by a long shot.
-
try adding the word "week" in there echo date('Y-m-j', strtotime('Monday+'. $i . ' week')).'<br />';
-
Do i need to save a file after imagefilter()?
Zane replied to BrettHartel's topic in PHP Coding Help
What does your current attempt look like? -
What 'state' is a select in when the user clicks it?
Zane replied to njdubois's topic in Javascript Help
This is one of the many many reasons to learn jQuery. The change() function provided by jQuery should cover every aspect of it being changed.. whether you used the keyboard of mouse. You may also want to check out this answer for cross-browser support so the keyboard change works all of the time http://stackoverflow.com/a/12401844/401299 -
IF a field is not required in your form, then that field in the database should be set to allow NULLs.. As for your idea of checking for optionals... It looks good to me.. but I would make use of the null keyword.. and use a ternary operator $optionalOne = isset($_POST['optionalOne']) ? $_POST['optionalOne'] : null; $optionalTwo = isset($_POST['optionalTwo']) ? $_POST['optionalTwo'] : null; $optionalThree = isset($_POST['optionalThree']) ? $_POST['optionalThree'] : null; Then, you can have a full INSERT statement with all 100 fields in it. Anything that is optional and is not filled out will go into the database as null.
-
The key to accomplishing something like this is to populate every row with every vital piece of info needed to find it in the database. Additionally, the use of jQuery's (Javascript) AJAX functions can make this tremendously easier if you aren't doing that already. Anyway, When you are populating this table that you showed in your screenshot, you would insert the vital info in the source code of that table. <tr class="user" data-id="1234"> <td><input type='text' name='username' value='zane'/></td> <td><input type='text' name='email' value='zane@domain.com'/></td> </tr> Given the above format, we can use jQuery to extract certain info and send that data to an external PHP script upon changing the text box value.... or however you want to trigger the change. $("tr.user input").change(function() { var $userid = $(this).parent("tr.user").data('id'); $field = $(this).attr('name'); $newVal = $(this).val(); var update = $.ajax({ url: "script.php", type: "POST", data: {table : "users", id : userid, field : field, newVal : newVal} }); }); Then, on your script.php page you can find this information in POST and do with it what you will. None of this code is tested... it is simply an off the top of my head suggestion.
-
The URL went nowhere anyway.. I checked it out, what was the fuss about?
-
I would do as Barrand suggested yet add the lineItems key to it. $i = 1; foreach($Order->Cart->contents as $Item) { $lineItems['lineItems'][] = array ( 'itemId' => $i++, 'name' => $Item->name, 'quantity' => $Item->quantity, 'unitPrice' => $Item->unitprice ); } $whatYouWant = var_export($lineItems, 1);
-
What is the differences between Wordpress.com and wordpress.org?
Zane replied to JohnnyCash's topic in Applications
On Wordpress.org, there is a download button. There is the difference. -
Never figured VARCHAR would do that. Learn something new everyday.
-
column3 and column4 MUST be in a numerical format like INT or FLOAT in order for that comparison to work.
-
I am taking a shot in the dark here, but maybe this is what you are wanting? $data = array(); while($r = mysql_fetch_array($query)) { $k = $r['id']; $data[$k] = $r; }
-
calculate percentage for more then 3 varibles, need some help!
Zane replied to jac.kock's topic in PHP Coding Help
Well that's a relief. -
calculate percentage for more then 3 varibles, need some help!
Zane replied to jac.kock's topic in PHP Coding Help
value 1 = 19 value 2 = 33 value 3 = 12 value 4 = 5 value 5 = 129 ----------------------------- total = 198 value 1 = (19 / total) * 100 = 9.6% value 2 = (33 / total) * 100 = X% value 3 = (12 / total * 100 = value 4 = ......... value 5 = .......................... -
- 2 replies
-
- paypal ipn
- php
-
(and 1 more)
Tagged with:
-
Here ya go. http://www.sitepoint.com/forums/showthread.php?530093-Regex-Help&p=3713338#post3713338
-
Well first off, where is this $row variable created? Not to mention $result[0]... You ask for help with debugging yet you do not provide all the relevant code. That's like taking out your car's alternator.. bringing it to the mechanic and saying "My car just won't start.. why not?"
-
It is possible, but doing so would require the editing of operating system files. You would have to append something to the OS functions for file traversing/copying/deleting/etc... that triggers a php script to execute as a command in the background. I myself have no idea where to even begin doing such a thing, but editing the OS files is definitely where you would sniff around.... and that could have hazardous effects if you do not know what you are doing. Surely there is some software out there that can keep up with your file modification actions so that you don't have to risk your OS.
-
You can't just expect us to look at this and figure out what your problem is. You've made it apparent that you want to show a captcha after 3 failed login attempts, but it would make things move smoother for everyone if you pointed out what is or is not doing correctly?
-
PHP's DOMDocument class is the most effective method for scraping... unless of course you just LOOOVE regex that much... I would imagine not. Something like this should get you started $doc = new DOMDocument(); libxml_use_internal_errors(true); $doc->load('http://somewebsitepage.wtf'); $xpath = new DOMXPath($doc); $nodes = $xpath->query("//div[@class='ProductPageNav'/a"); foreach ($nodes as $node) { echo $node->nodeValue(); }