-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
What's so complicated with having sub-directories?
-
What you're after is too bespoke. You'd need to write your widgets to work with a specific system, like for example Wordpress. You need to decide which platform you'll be using before you can even think about where to get widgets from.
-
Why "ugly"? I mean, I use htmlspecialchars() myself generally, but htmlentities() just encodes more characters. When escaping user input the idea is you have little to no HTML anyway, so it's not exactly ugly but just more than necessary.
-
There's no need to fit everything onto one line. Split it up, it makes the code more readable: $height = trim($_POST['height']); $height = mysqli_real_escape_string($db, $height); I actually left out htmlentities(), as this is something you should do as you output user input, not prepare it for saving to a database.
-
I don't think linking to a forum post is the best way for you to maintain a log of updates to your site. If I had never been to this forum and saw your site, it would scream unprofessional to see a link to a seemingly unrelated site containing updates, suggestions, and more importantly; faults bluntly pointed out. Try and keep your update log positive and held on your own site. Gain traffic through natural means and/or advertising. Going back to the nature of the site, I too expected to see translations for an actual foreign language like Chinese or Malaysian. I don't think there's any potential on the internet these days for something like this, or at least where I'm from. By all means carry on if you're using this as a learning experience, but to be truthfully honest I don't think this is going to go anywhere. Sorry to sound harsh.
-
Look at the code, you're passing "ENT_QUOTES" as a parameter to mysql_real_escape_string().
-
Yeah. I doubt you'll run into any backwards-compatibility issues.
-
Try cleaning up the external scripts before anything else. Do you realise you're including the jQuery core three times? You also have the UI core twice.
-
I linked you to a PHP extension - "SOAP" - that was built for this. Take a look at some of the examples.
-
That's assuming the php.ini setting for "session.cookie_lifetime" is set to 0, which may not be the case if dotkpay is having issues. @dotkpay Can you confirm the value of the ini setting I mentioned above, or let us know if you're using a custom session handler?
-
There's a few ways of doing it. 1) Include an ID within the URL, making the post title redundant beyond SEO purposes. This would be best performance wise and you never have to worry about collisions. 2) As you query the database, you can pass the title column's value through an identical string manipulation process for comparison. Least preferable for performance, and dealing with collisions would be more complex (how many posts on here are created with "HELP!" or something?) 3) Or lastly, and the most clean way in terms of SEO, would be to store the post title within the database and look-up based on that. You could add a unique index to improve performance, and deal with collisions as you insert the row. Edit Just to be clear, this how you would solve the issues if you convert the slash to a hyphen - which I definitely recommend.
-
You need to use preg_replace_callback.
-
Ideally you would have three servers; development, QA and production. The QA server, although not essential, would be as identical to the production server set-up as possible. It's less likely you can do this on DEV, as I imagine you work from Windows and have a Linux-based host. Never the less, you want a fully working development environment you can test changes as you work. If you have a QA environment, first you would upload there to test how they perform within a similar set-up. If all is well, you would then roll to the production servers. Obviously if you don't have a QA server you would just roll to production.
-
Looks like you've missed out the order by feedprice in the sub-query.
-
Sorry, bit rusty. You need: [...] jointable(id) REFERENCES users(id) [...]
-
This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=343994.0
-
The x is required because you need to specify a name for the derived 'virtual' table - you could access the columns like "x.feedprice". Using * would only really make it faster if you were selecting columns you weren't using. In this case you're already specifying those columns within the inner-query, so I don't think you need to worry about using it on the outer query.
-
This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=343748.0
-
Remove the brackets around "jointable". To have it auto update you need to add to the end: ON DELETE CASCADE ON UPDATE CASCADE
-
You may be better off using the jKey plug-in. It makes targeting specific keys extremely simple. For example: $(document).jkey('alt+o', function() { alert('Pressed Alt+o..'); }); Just download the plug-in, include the jQuery and jKey scripts within your document (jQuery first), and add that code within a script block. That easy..
-
I have never attempted to do anything like this, so apologies if I'm not completely accurate. From my understanding of GPS the mobile phone would receive it's position from the satellites, then would need to ping that location to your web service (would probably require an app on the phone). Your server would then use the GPS co-ordinates to plot the location using the Google maps API, and render within a browser. I would imagine there's some form of support for GPS co-ordaintes within the API, and Android/iOS probably have some built-in utilities to make the mobile process easier as well. I don't think it will be a case of mobile or server application; you're going to need to combine the two.
-
Ah, my mistake. Currently it's returning the lowest price from all of the child products, instead of the lowest price per product. Just need to add in a GROUP BY: [...] ) as x group by product_id;
-
You just need to bind both events to the same handler, although with the key detection you'll probably want to have an anonymous function first determine which key was entered, and then call the function if correct. For example: $('.menu').mouseover(displayMenu); $(document).keypress(function (event) { if (...) { displayMenu(); } } function displayMenu() { $('.menuContent').show(); } Edit Not sure if I answered your question there. Which bit do you need help with exactly?
-
We don't, always. Placing JavaScript within the head means it's executed before the page is loaded. JavaScript within the body is executed as that point in the mark-up is parsed - if that makes sense? Think of having one external JavaScript within the head called "pre-load.js", and one just before the closing body tag called "post-load.js". Of course if you try to interact with the DOM in a pre-load script it won't work, as it doesn't exist. So executing code pre-load is quite limited, and is why people wrap it within an onload event. The reason more and more people are starting to include a script before the closing body tag, is to allow the page to load faster and escape using the onload event.
-
Which is line 35?