hey all i am trying to make a data output stream in php
to write back primitive data types to a java application
i created a class that write the data to an array
(write it same as java do , copy from java code)
and finally i am writing back the array to the client.
feels like its not working well
for example the writeInt metho...
I didn't want to keep repeating the same select query, so I wrote this function. But it doesn't work:
function select($what, $table) {
$query = mysql_query("SELECT $what FROM $table");
}
select(*, products);
...
Hi guys I'm debugging my application here and basically in a nutshell - the application is dying out on my online server or maybe its my server dying out. But I have checked this application three different servers and all exhibited similar results, the application would run for a while but all of a sudden once I'd be opening more and mo...
Hello,
Can anybody tell me how are exceptions handled in PHP? I have this code
try{
$this->b->methodthatraisesexception();
}
catch(Exception $ex){
echo "Hi Hi hi, you tried to deleted a non existing file";
}
When i try to run this code instead of seeing the echo message, i see some kind of weird PHP error occured message. Btw, t...
I want to dump request variables to a file for debugging. How's this possible?
...
I have some several codes in PHP to do jobs that MySQL could do.
such as sorting, merging each data from different MySQL tables, etc...
Lately, I found out that I can do all these stuffs with one MySQL query.
I am wondering is it better to give the MySQL capable jobs to MySQL or to PHP.
efficiencies, speed, etc..
Thank You,
...
I do have an xml generator written in PHP. sample is given below but few lines only due to space issues.
$output = '<?xml version="1.0" encoding="UTF-8"?>'."\n";
$output .= '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:ta...
I recently found the code below in one of my directories, in a file called doc.php. The file functions or links to a file manager. It's quite nicely done. Basically, it lists all the files in the current directory, and it lets you change directories.
It had access to all my files (add, rename, info, delete...). I don't remember installi...
I have some code that generates bills for multiple customers on one web page. I use the div element style="page-break-after:always" so the user can print every customers bill at once, and the bills for unique customers will all be printed on a separate sheet of paper. My issue is that I want the bills to be a little more readable on th...
I found there are a lot of articles comparing Nginx and Apache in Internet. However, all these comparisons are based on stress test to web server running PHP code. I suppose this is mainly due to Apache is generally deployed with PHP as LAMP architecture.
In my understanding, Nginx is created to solve C10K problem with event-based arc...
Hello, I'm trying to post a serialized form to a sumbit.php file, in turn, will then insert into a MySQL database; however, the last input which is hidden, is not getting inserted into the database, though the rest are.
Here's some snippet examples of what I've got thus far which is not working:
HTML
<form method="post" ...
i am wondering why my namespaces are not resolved correctly ... i have
use \Doctrine\ORM;
...
} catch (NoResultException $e) { // shld resolve to \Doctrine\ORM\NoResultException but fails
...
} catch () {
// code always ends up here if NoResultException is thrown
// unless i fully qualify the class as\Doctrine\ORM\NoResultExc...
Hi guys I'm trying to optimize my application here and have started to benchmark snippets of code as to how much memory they are taking up. I just discovered that a single include statement is taking up to 1.5MB of memory. I'm using memory_get_usage() to check for memory used before adn after a snippet of code.
The file included include...
i also want know how to authenticate and use Google SMTP server.
...
I am a beginner at Jquery. What i want is to display the data using AJAX in a step by step manner. So let say if in my database there is a table "DATA" with a field name "info" having multiple rows as a data
info
1
2
3
4
5
Now i want to display all the five rows but after a certain delay of time let say after a second.
So i want to ...
I have the following code
echo '<pre>';
print_r($this->region_id);
echo '</pre>';
if(end($this->region_id) != 0){
if($this->region_id[0] == 0){
array_shift($this->region_id);
}
}
echo '<pre>';
print_r($this->region_id);
echo '</pre>';
Somehow it's not removing the first ...
I need to edit the inside of the following comment tag so that I can change the location of the css file. This needs to be done through PHP. I have tried using the following code but I get invalid expression errors.
Comment Section:
<!--[if IE 6]><link rel="stylesheet" type="text/css" href="/Css/IE6.css" media="screen" /><![endif]-->
...
EDIT: I solved it seconds after posting the question (sorry!) but can't accept an answer yet.
Hi folks,
Just a quick one. I have a PHP/CodeIgniter site and the user can edit their profile. I'm using CI's XSS Filtering and Active Record-based Models, so the data is escaped automatically.
It naturally displays fine on the profile page v...
In the admin area of my site there is a form which is for the hostname, username and password for the mysql database that the site uses. Currently these values are hardcoded into a php class. But who can I link it so the form can edit the variables in the php class (and keep the results on the server, in other words the variables are har...
How can I pass the model in array format.
I want to pass models in this format from controller to view:-
Users[user_contact]=Contact
Users[user_contact][contat_city]=City
Users[user_contact][contact_state]=state
This is what I am doing
public function actionCreate() {
$user = new Users;
$presContact = new Contacts;
$presCi...