Hey everyone,
I have a pretty long SQL query that I use to, for all of the users in a particular "region", for a given month, calculate the number of days that they have been on "duty". This is broken down into weekends and weekdays. Here is the php/SQL statement:
$result = mysql_query("
SELECT fname, lname, MONTH( eventDate ) AS MO...
I have some PHP source code that I'm hosting with hosting company XYZ. I'm using a PHP encryption software like Zend Guard or ionCube to protect the source from being viewed by anyone (sysadmin or hacker that hacks the sysadmin).
How easy/hard is it for someone who has full access to the system (like the sysadmin or hacker that hacks t...
What does this code mean and what are other ways accomplish the same without using bit shifting?
if ($n & ($n - 1))
...
I have some old php code that has been working happily. I need to do some updating and have moved the code to another machine. Everything is fine except this smarty code no longer works.
{$smarty.get.myvar}
I know it must be to do with differnt config settings but i can't figure it out. Register_Globals is off on both installations....
Hello,
I have a question: How go from one *.php file to another *.php ? In example if I have this in index.php
<?php
<form method="POST" action="second.php">
<input type="button" name="GO">
</form>
?>
and in another second.php:
<?php
if ($_POST['GO'])
// HERE SHOULD BE SOME CODE LIKE INCLUDE OR SMTH TO GO TO index...
Hey Guys, I'm relatively new to the Web Development business. Me and 2 friends started up our own little company. 1 person is a designer, 1 person is sales / consultant, and I am the developer. Right now, its an after work project, but we hope to expand and let it become our full time jobs.
Anyway, my question to you, is what is the b...
On my PHP application, I allow users to upload images.
I then process the images to resize it to a manageable size.
Within my PHP script, I run the following UNIX command (ImageMagick):
convert -size 320x240
This limits/constrains the height/width to be no larger than 320 by 240.
However, I don't know actually what size "convert" r...
I am looking plugin for work with Smarty in NetBeans.
I need coloring of my code and normal syntax analysys.
I could find only this plugin: Smarty Editor, but I could not make it work.
Can you tell me about another plugin for Smarty or teach me how to install SmartyEditor?
Edit: I use Windows XP SP3
...
Which PHP framework should I choose if I want to be able to develop in both PHP and Ruby and Rails without having to make too much of a mental jump when I move from one to the other? It does not have to be an exact copy, but should have most of the basic features of Rails.
That is, it should include similar routing (either /controlle...
I have the following table: http://kimag.es/share/59074317.png
columns = [id cid comment]
I need a way to make the values of cid (comment id) increase by 1 for every row in the table.
row 1, cid=0
row 2, cid=1
row 3, cid=2
etc.
Now cid=id because of this php script:
<?php
$con = mysql_connect("localhost","MYUSER","MYPASS");
if ...
Hi!
I have a multidimensional array like this:
array(2) {
[1]=>
array(3) {
["eventID"]=>
string(1) "1"
["eventTitle"]=>
string(7) "EVENT 1"
["artists"]=>
array(3) {
[4]=>
array(2) {
["name"]=>
string(8) "ARTIST 1"
["description"]=>
string(13) "artist 1 desc"
...
Hi,
This question should be pretty simple. I have a php file in a directory that contains function calls to read files in that directory. I need to be able to access those functions and call them from outside the directory. Is there a way to make php execute those functions relative to the file that they are physically in vs the file th...
I am coding in PHP on Apache, and I have access to two main areas on the Unix server. I have a personal directory and I have a project directory. I noticed that in the project directory there is a extension/module that I have access to automatically which I don't have in my personal directory (I can see it listed in phpinfo()).
So I'm g...
If you had data in table 1 that you need to use to return data in table 2 for each row returned in table 1. What is more efficient to use a set of querys in PHP one inbedded in the while loop of the other or an SQL function within a query?
for example:
$qry = mysql_query(SELECT date FROM table1)
while($res = mysql_fetch_array($qry))
{...
On NetBeans 6.7.1 with PHPUnit 3.4.1, If I try and run the test I setup in NetBeans it errors out and can't execute the test, here is the output:
PHPUnit 3.4.1 by Sebastian Bergmann.
The --log-xml option is deprecated, please use --log-junit instead.
Argument #1 of PHPUnit_Util_Fileloader:checkAndLoad() is no existing file
The test ...
Hi,
I'd like to port a generic text processing tool, Texy!, from PHP to Java.
This tool does ungreedy matching everywhere, using preg_match_all("/.../U").
So I am looking for a library, which has some UNGREEDY flag.
I know I could use the .*? syntax, but there are really many regular expressions I would have to overwrite, and check th...
My page is made in php, I have qcodo which is layered on top of my database for the website.
Occasionally, the webpage does not render and instead of the content it should display it displays the website URL in the body. This problem started occurring after I added few fields in the database. At first I thought this might be a qcodo pr...
I'm trying to heredoc the following code:
<?php
//some php
//some more php
if (some condition) {
?>
<label>CMKS1<?php echo $CMKS1_CMKS2_space; ?>CMKS2</label>
<input name="cmks1" type="text" class="base-cls <?php if ($err1) echo "err-cls"; ?>" />
<input name="cmks2" type="text" class="base-cls <?php if ($err2) echo...
Hello,
I have a foreach loop that is suppose to check to see if a checkbox is checked by an item. If the checkbox is checked I need to see if the file upload part of the script has a value and if so then proceed to check the file type and size of the file the user is trying to upload.
Currently if there is only an error with the firs...
Hello,
I recently upgraded to xampp v1.7.2 which dumped PHP 5.3 on me. Along with that all my httpd.confs and php.ini's got wiped out (I had taken it for granted that this release will be an upgrade like all the earlier xampp releases). Anyway, it took me a while to reconfigure all the services - but now I've run into a funny problem....