I've searched for this but can't seem to find the exact answer. I want to use array_multisort to simultanously sort 3 arrays based on numeric values in 3 of the arrays. Basically I want to make a "standings" table similar to what you'd see for NFL/NHL standings etc. I have 3 arrays, tempIDs (string), tempWins (numeric), tempWinPercentage...
i just got the hang of using jquery ajax
for example, this code sends the contents of the comment box to the php file.
$.post("user_submit.php", {
comment: $("#comment").text()
});
the question however is how do i receive the data in the user_submit.php file?
...
I've got a database site that will serve approximately 1,200 primary entries at launch, with the prospect of adding ~100 new entries per year. Each entry would be composed of ~20 basic values from the database, as well as a calculated average rating, and a variable amount of user comments.
The rating and comments output would have to be...
Here's the current flow of my quiz app:
users/do_program
quiz_contents/view
quiz_questions/do_quiz
The checking if the user has to do another module after finishing the current ones are in the quiz_contents and quiz_questions controller which I think can be improved because of the duplicate code. So what would you guys suggest?
Some...
I need a base_convert() function that works from base 2 up to base 62 but I'm missing the math I need to use, I know that due to the limitations of PHP I need to make use of bcmath, which is fine.
Functions like these convert a number to and from base 10 to another base up to 62, but I want to implement the same functionality of base_co...
i am using the following jquery to post comments to user_submit.php
var submit = document.getElementById("submit_js");
var comment = document.getElementById("comment");
$("#submit").bind('click', function(){
$.post("user_submit.php", {
comment: $("#comment").text()
});
});
the user_submit.php listens like:
$comment = htm...
Hi I'm using CakePHP and I'm wondering do you guys puts isset() or !empty() around all of your variables in the views? Or should I depend on the data validation? What would be the suggested solution?
...
After I retrieved mysql result from db, I wish to add row number value '1' '2' '3' etc to each results[].
if($products)
{
while($row = mysql_fetch_array($products)){
$results[] = $row;
}
...
As it stands, I have some JQuery along these lines -
ph=function(i){
$.each(i,function(po){
id=po.id;url="/"+id;t=$('<div id='+ id +' class=entry></div>');
t.html('<div class=hx><a href="/users/'+ po.author +'">'+ po.author +'</a></div><div class=b>'+ po.body +'</div>');
t.prependTo($("#modpskx"));
t.hide();
t.slideDown("slow");});};
fu...
Suppose the input is:
222.123.34.45 and 222.123.34.55
then I need to output the ip address in between them:
222.123.34.45 222.123.34.46 ... 222.123.34.55
...
I have an array that I can't seem to get my data back out of. What I would like is for each name (test1...) to have multiple urls associated with them. If you look at the last test (test5), there are 2 urls but this foreach loop only gives me one. Why?
Here is the array structure and my foreach loop.
Array
(
[test1] => Array
...
I am wondering if there is a way to specify a php function or file to be called every time a user visits and exits a page on my site. So if a user visits say example.com/ex.php can I have a function called before ex.php is run and after ex.php is finished?
I want to be able to record the time it takes to execute php files on my site and...
UPDATE
this is the screenshot of the alert:
i am using the following JQuery function to successfully POST data to the user_submit.php file, its just that the php file is unable to receive the data.
$(function() {
$("#submit_js").click(function() {
$.post("user_submit.php", {
comment: $("#comment").val()
});
}...
Is there a way that I can make codeigniter only display "« Older Articles" and "Newer Articles »" instead of displaying page numbers and all the other stuff?
...
I'm coding up a small script that'll take form data and do something with it. If it fails, it shows the error and the form again. If it succeeds, it'll show a success message.
The backend code is using classes that'll throw exceptions if there's an error with the form data. The calls to the classes will be wrapped in a try{} catch{}.
W...
Hey all,
I was wondering if anyone had any experience with thrift and could provide an example of taking a PHP array (or object) and translate it into a C++ array (or object). Either that or point me to documentation on how to do this in PHP (which is incomplete on their website!)
Thanks!
Matt Mueller
...
i've got a website that shows search results with ajax. but of course when i click on a thread in the results and then go back with the web browser back button the results are gone.
is there a way to go back to same result page displayed by ajax?
cause i really want to use ajax for certain tasks, but it wouldnt be nice if the user has ...
I am currently using the script below to output the contents of a JPEG straight from a file. The reason I'm doing so is because I'm using mod_rewrite/php to mask the name of the original file. This is working partially as expected, except that Safari insists on downloading the photo instead of just allowing me to see it in the browser. A...
Hi,
I have seen Zend certified engineers growing fast with upper hand over others.
I am also planning to take this exam.
I just wanted to know what areas of programming should I be more focused on when
preparing for this exam. Any help from zend certified engineers will be greatly appreciated.
EDIT
Also suggest good resources about t...
I'm trying to write a query that returns the user ID's of the top 10 users who gained the most points in the last 7 days on my web app.
I have three tables that, together, have the info I need.
votingapi_votes table. It has a record for every up/down vote on a comment or node.
node table. It can associate a node ID with a user ID so...