php

How to display a students total grade points correctly using PHP & MySQL?

So far I think I'm doing it right but I cant seem to display the grade_points correctly here is what I'm display below. How can I fix it so that my code will display the grade_points correctly? OUTPUT DATA Here is my current output: user_id Array ( [1] => 1 [3] => 2 ) rank Array ( [0] => 1 [1] => 3 ) grade_points Array ( [0] => [1] ...

using lightbox with code igniter

I'm trying to use Lightbox with my CodeIgniter application. Lightbox says to put the following in the head tag: <script type="text/javascript" src="js/prototype.js"></script> <script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script> <script type="text/javascript" src="js/lightbox.js"></script> <link rel="s...

Include multiple functions in a PHP file and call them through jquery.post or jquery.get in a javascript file

I want to call various functions made in PHP from my javascript file. Normally using Jquery.post we call a PHP file and and pass various values as post. function new_user(auth_type, tr_id, user_name, email) { $.post("bookmark.php",{AuthType:auth_type, TR_Id:tr_id, UserName:user_name, UserEmail:email}); } If I want to c...

validate email addresses with IDN in php

How to validate email id having special characters (i.e. unicode/IDN)? I tried filter_var("[email protected]", FILTER_VALIDATE_EMAIL) but that's not working out properly. ...

Modernizr With Codeigniter

I am having difficulty trying to get modernizer to run with codeigniter. this is what I've done so far. downloaded Modernizr and renamed the file modernizr-1.5.min.txt to modernizr-1.5.min.js put the JavaScript file in the same directory as my header file is: apppath/views/tops/ included the file in my headings <script src="modernizr-...

Suggest another method of achieving this "word stack" which resolves the known issues my method is a victim of.

I am trying to transform a set of two radio buttons in a stack of two labels, one blue and on gray representing, respectively, the selected radio and the unselected one. Clicking on this stack will change which of the labels is blue (and which of the radio buttons is checked). It works well but it breaks down in an ugly manner when the t...

Google Chrome renames file .xml to .download

hello. i have this very simple download page to get an xml file. the script works ok in firefox/IE. but chrome renames the extension of the file to ".download". and this happens only to .xml, when you use another extension like .txt it does it without problems. the body of the html is this: <body> <a href="down.php">descarga</a> </bo...

Where to learn Yii?

Hi, I have been trying to learn Yii without luck. I find Zend Framework, Kohana, Code Igniter among other frameworks much easier to learn than Yii. The documentation also su**s. Can you post links to easy-to-understand and well written tutorials/articles? The official documentation is filled with grammar errors and seems to be rushed......

send $_FILES to other function

hi, how send $_FILES to other function? <?php function save(how get $_FILES["img"] ??) { //$img = $_FILES["img"]; How get $_FILES["img"] ?? $user_file = $_FILES['img']['name']; $file_temp = $_FILES['img']['tmp_name']; $new = "new/"; move_uploaded_file($file_temp, $new .$user_file.''); echo "<br><b>OK<b>"; } i...

XAMPP won't allow me to send email.

So, I'm trying to get my html form hosted on the company I work for's intranet to be submitted to several email addresses using PHP. I am testing the code using XAMPP, and everytime I try to submit, I get this error: *Warning: mail() [function.mail]: Failed to connect to mailserver at "172.23.38.10" port 25, verify your "SMTP" and "smtp...

getting image with php and displaying in html

i know it is so simple problem but eventually it isn't working and i am a newbie. in the index.html, a swf sends an image and displayImage.php(below code) should display it on another page. why isn't it working?? <?php if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] )) { $no=0; while (file_exists("images/$no.jpg")) $no++; header('Cont...

import bulk data into MySQL

So I'm trying to import some sales data into my MySQL database. The data is originally in the form of a raw CSV file, which my PHP application needs to first process, then save the processed sales data to the database. Initially I was doing individual INSERT queries, which I realized was incredibly inefficient (~6000 queries taking almo...

The most elegant way to walk trees in PHP

I have trees like this one: $tree = array("A", array( array("B", 1), array("C", 2), array("D", array("E", array("F")), array("G")), array("H", 3))); Each node is an array, type of node is its first element and other elements are node's ...

smarty, send to file date

I have in a PHP file this array: array(1, 2, 3); How can I send this array to a Smarty .tpl? ...

What are the implications of opening MySQL connections over and over again in PHP

Specifically, I have a DB class that opens and closes multiple MySQL connections every time I call the Query function in the class. Should I open a connection once? or is it ok to open and close connections like this? ...

How do you change the default Pear/PECL build folder from /var/tmp?

I'm trying to install a PECL package on Linux, but the installer never gets past the configure stage. My hosting provider mounted a file system at /var/tmp that prevents files from executing, and that's causing this error: root@host [/usr/local/apache/conf/includes]# pecl install pdo downloading PDO-1.0.3.tgz ... Starting to download P...

Can anybody suggest a good Debugging package for PHP?

I use firebug and smarty so i get good debugging data from that but i'd like to see my database query times and page processing times as well. ...

Query not returning results when a "WHERE" condition is added to it

The query below is not returning any results. I have copied it from a query that was working and the only thing different is the addition of the following condition: WHERE submissionid=$submissionid Any ideas why this query is not returning any results? $sqlStr2 = "SELECT s.loginid ,s.title ...

create online files.

Hi, i want to make some .doc files with some entries in a database. here is what i wrote: $name1=$user->username; $name2=$nume; $name3=$_POST['util']; $cale="../doc/"; $file_name=$name1 . "_" .$name2."_".$name3; $fp = fopen($cale, $file_name . ".doc", 'w+'); $message="Zhtml>Zbody> <table width='100%' border='0'> <tr> <td align='cen...

Should I sanitise my sessions in php ?

Obviously one should sanitise sessions when the're being created, but what are peoples thoughts on sanitising a session before using it? ...