ManiacDan
Staff Alumni-
Posts
2,604 -
Joined
-
Last visited
-
Days Won
10
Everything posted by ManiacDan
-
Updating the quantity and having that update your subtotal is very simple javascript, just register a function to onchange that recalculates the total from the form and updates the span (or whatever). A normal form post can submit to the database when they move on to checkout. AJAX is unnecessary here. -Dan
-
Or just plain old javascript, if your product catalog is relatively small. One question though: How are they altering the cart without reloading the page?
-
newb needs help: Single quotes going into a database... err...
ManiacDan replied to doofy's topic in PHP Coding Help
$sql="INSERT INTO web_articles (ArticleDescription, URL)"; ...you removed the values from your query. You're also, as you can see, not actually getting anything into your two variables anymore. You need to take a step back and tackle this one section at a time. FIRST: Get those variables populated again. You clearly broke or deleted the section that sets them. If you never set them and you're relying on a "feature" called register_globals, you're doing it wrong. That feature is supposed to be OFF and will disappear entirely in PHP6. SECOND: Now that you have the variables, ensure that the before/after for mysql_real_escape_string is correct. THIRD: Build a properly formatted SQL statement and echo it out. Copy/pate it into your query browser or phpmyadmin and ensure it works. FOURTH: Take that SQL and run it in your page. -
Using an id that was generated via auto incrementation using "null"
ManiacDan replied to Noonga's topic in PHP Coding Help
While Thorpe is being pretty blunt, it's still true. Reading the entire mysql section, including the comments, would take you half an hour. It may seem daunting but there's really not that much text there. The manual is laid out in such a way that you can even start from a list of all MySQL related functions and just read the list to find one that looks like what you want. Even if you pick the wrong one, you still win by learning something new. -
Wherever you plan on putting them.
-
There were three messages here about someone posting in this thread by mistake, they've been removed so it's not so confusing. Carry on.
-
You need one form for every row. Right now, from the looks of it, your form contains X copies of each element, so only the LAST ones are being submitted. Put opening and closing form tags, as well as submit buttons, in each row inside the loop. -OR- Name your inputs like this: ?> <input name="newRowContents[<?php echo $row['id']; ?>]" type="text" value="<?php echo $row['name']; ?>" /> <input name="oldRowContents[<?php echo $row['id']; ?>]" type="hidden" value="<?php echo $row['name']; ?>" /> <?php Now, $_POST will be an array of arrays, $_POST['newRowContents'] will be an array of the boxes you type in, keyed by row ID. $_POST['oldRowContents'] will be an array of the old row contents, also keyed by row ID. So you can: foreach ( $_POST['oldRowContents'] as $rowID => $contents ) { if ( $contents != $_POST['newRowContents'][$rowID] && !empty($_POST['newRowContents'][$rowID]) ) { //do your update for this row } }
-
You're mixing usage of $db with the base mysql functions. One or the other. $db->execute() returns a result object meant to be used however the $db library is designed (you don't say what you're using). You cannot pass a result object back through the query function, the query function expects a string and will return false when you give it an object. Then, you take that false and pass it into the fetch function, which throws the error you posted (which should have been in your first post).
-
Move the fonts outside of your webroot so that even if they can see the font location they cannot download them.
-
Both your inputs have the same name.
-
Now that there's two mods saying the same thing, I'm closing this thread.
-
Please don't report posts simply because you don't like what they say. If someone purposely obfuscates their website so you cannot make a copy of it, then they do so for a reason. Downloading a copy of a website is illegal in the United States and in many other countries (I am not a lawyer). There exists a PHP class that emulates a browser {url removed}, complete with cookie storage and retrieval, but it does not parse javascript.
-
You said you could already parse it, give us the code you're using to parse the file.
-
Using an id that was generated via auto incrementation using "null"
ManiacDan replied to Noonga's topic in PHP Coding Help
Also, you don't need to explicitly name the auto-increment column and pass it a null, simply leaving it out of the query entirely will still auto-fill it. -
Please don't tack your problem on to an existing thread that has already been solved. Your post has been split off into its own thread. Do you have any errors to show us? you say that you can see things working, what else do you see? As this is XML, you may want to look into the SimpleXML library instead of the DOM. -Dan
-
Hah! You're right, I didn't even see that link, my brain filtered it out as a signature. SURAT, you do not have PHP installed or your apache is not configured for PHP. The best recommendation is to simply uninstall apache and install a PHP/Apache stack appropriate for your operating system. XAMPP for linux and WAMP for windows.
-
gristoi, he says it works when he visits index.php directly, so it's definitely a default document problem.
-
Your default document isn't set properly in your webserver, it's not looking for index.php.
-
I don't know if IE does or not, I'm going to assume that it doesn't but the last time I owned a windows machine was during the days of IE7. However, even if it did, it wouldn't support things like spoken last names. Nobody, not even concierges at expensive hotels, has ever gotten my relatively mundane Irish last name correct. To expect a computer to is silly.
-
I'm no expert on speech recognition but I do know this is BS. Technologies like speech recognition are implemented in far higher level "user space" applications. Wait...what? Speech recognition is built into the OS in Windows, Android, Mac, iOS, and various flavors of Linux (though not yet Ubuntu). Maybe it's an "application" and not technically a part of the OS, but when you first install the OS, it's there. There are other apps (like bonzi buddy and chrome) that roll their own for voice commands, but speech-to-text inputs (which is what the OP asked for) is an OS-level feature, at least in some of the the OSes I use every day.
-
One Login Form can differentiate user or admin
ManiacDan replied to shebbycs's topic in PHP Coding Help
I'm afraid either the language barrier is too strong or your skill is too low. I'll try to ask it step-by-step: 1) I visit your site 2) I log in 3) I visit an area that can only be access by members who are logged in 4) WHAT HAPPENS HERE? 5) The page is displayed because I am a verified member. -
PHP is a server-side language, and therefore can never do something like speech recognition. Also, speech recognition is not robust enough to support what you want it to do. Speech recognition, if used at all, is built into the operating system and you don't have to worry about it.
-
One Login Form can differentiate user or admin
ManiacDan replied to shebbycs's topic in PHP Coding Help
Answer the question first. When a user visits a page on your site that requires them to be logged in, how does the site determine if they're logged in? -
Exactly.
-
That assumes you know what order the user is entering the date in. If you're 100% confident that they'll always use that order (and they're not, say, european or a smartass like me) then you're fine.