-
Posts
1,469 -
Joined
-
Last visited
-
Days Won
12
Everything posted by CroNiX
-
Put the url to the delete function there, not CALL the actual delete function. Just like you are for the first button on the same line where you give the url to the function, editaAtividade.php?id=
-
All you'd do is output the HTML necessary to generate the tabs that the jquery tabs plugin requires along with executing the javascript. Your question is fairly broad and I'm not sure what it has to do specifically with PHP.
-
$this->removerAtividade($id) Seems like your code is telling it to. It's executing a function here, not creating text for a link href.
-
add background color if Value is an odd number
CroNiX replied to kat35601's topic in PHP Coding Help
This can be done purely with CSS and no other coding. http://www.w3.org/Style/Examples/007/evenodd.en.html -
You're loading jQuery, but not using any of its powerful functions which would make your code a lot simpler and shorter. Why load jQuery if you're not going to use it?
-
Horizontal scaling (how to keep code identical?)
CroNiX replied to arbitrageur's topic in Apache HTTP Server
I usually just use git for that, but look into rsync if you aren't already using git. -
post your whole query.
- 11 replies
-
Well, yes. sprintf() is converting the %[identifiers], which mysql is also using. So don't use sprintf() when using those mysql functions that contain %[identifier]. If you use prepared statements for your queries, this will be a non-issue plus they are way better to use anyway.
-
Getting data from a previous row, based on the current row
CroNiX replied to frankchester's topic in MySQL Help
I can see that working using the auto_increment ID only if they don't allow deleting entries, otherwise I wouldn't count on (entry - 1) being the correct ID. -
Using ; like you are on the $(document).ready()
-
submit a form and unset a session variable on other page
CroNiX replied to Cyjm1120's topic in PHP Coding Help
When the form is submitted and the data processed, just redirect back to the main page? -
Why not use sessions instead of cookies?
-
Find the nearest div of dynamically added html?
CroNiX replied to Freid001's topic in Javascript Help
http://api.jquery.com/closest/ -
Find the nearest div of dynamically added html?
CroNiX replied to Freid001's topic in Javascript Help
That would depend on if you're using pure javascript or jQuery or some other library? -
Hit page without actually going to page that's NOT on your domain?
CroNiX replied to mouseywings's topic in PHP Coding Help
A CURL request is basically a normal web request, so the site will send whatever headers it normally sends as if you were visiting the site in your browser. Nothing special needs to be sent on their end like you do with the Access-Control-Allow-Origin using AJAX for cross-site requests. -
How to select question from mysql tables randomly ?
CroNiX replied to JosephHanh's topic in PHP Coding Help
You can just store the questions in an array and use shuffle() on the array. You can also use ORDER BY RAND() in your sql query, although I've read it's not as good in the past. -
Maybe it's just the formatting, but most of that code looks really broken due to things showing up on the next line where they shouldn't be. Stuff like: class // Instantiate Also, try setting more of the parameters like here: http://ctrlq.org/code/19589-send-mail-php
-
If the email needs to be sent each and every time the submit button is clicked to create the initial query, then just have that code also send the email so there is only one step. If it's optional to send the email, then a 2nd step would be necessary similar to what you described.
-
Just hide the left/top/right border of the form fields
-
Git is invaluable and easy to learn/use. Yes, you should learn it. It can save you from a catastrophe
-
Once you grab the page $content, use simple_html_dom to parse it and grab what you need, kinda like how you would with jQuery. http://simplehtmldom.sourceforge.net/
-
Wordpress isn't a framework, it's a standalone application. You can find info from their docs: http://codex.wordpress.org/WordPress_APIs
-
All the output buffering does is send the output once everything has been processed instead of "real time"...or "linearly, as processed". They really should take about the same time for the end user to receive both. The same calculations, as you put it, would take place in both scenarios. The only difference using buffered output is the users browser receives the entire document at once instead of like sending the header, waiting for something to be processed and then sending that out. So instead of the page being "drawn" in chunks, it's all done at once.
-
Saving files to a directory how to check that its there
CroNiX replied to JamesMore's topic in PHP Coding Help
You can use either. file_exists() works on both files and dirs and I usually use it for both cases. But yeah, is_dir() would obviously work for this. To get the filename/path without extension, why don't you just grab it before you add the extension? $raw_file = UPLOAD_DIR . uniqid(); $file = $raw_file . '.png'; ... print $success ? $raw_file : 'Unable to save the file.';