php

capturing curl stdout into variable in PHP

Task Downloading binary files from a remote media processing server to a web server. This works but I cannot capture the curl stdout output $result = shell_exec('curl -v http://domain.com/images/dir/dir/dir/file.jpg --user username:password -o /usr/www/htdocs/images/dir/dir/dir/file.jpg'); Note: I have had no luck using the PHP cu...

Problem with returning rows using PHP

<?php if (isset($_GET['flyerID'])) $FlyerID = $_GET['flyerID']; $DBConnect = @mysqli_connect("host", "UN", "pword") Or die("<p>Unable to connect to the datbase server.</p>" . "<p>Error Code ".mysqli_connect_errno().": ".mysqli_connect_error()) . "</p>"; $DBName = "agentsleuthdb"; @mysqli_select_db($DBConnect, $DBName) O...

Css Html JavaScript - Navigation Highlight current selected Menu

Hello, i think this question is very easy but I don't know if i am right. I am an oldschoool html, php coder. I want to use this kind of navigation: http://www.cssportal.com/horizontal-menus/13styles.htm So far no problem. I got an dynamic php page and i want to use this Menu. There is no problem without this line in the HTML Part: ...

better to use jquery on form submit button?

isnt it better to use jquery for form submit? like: Username: <input type="text" id="username" name="username" maxlength="30" /><br /> Password: <input type="password" id="password" name="password" maxlength="30" /><br /> <input type="button" id="register" name="register" value="Register" /> and then bind the id...

How to bind in PDO a string with %

I have the following query, (which don't work). How do I bid strings inside an existing string with % (I believe the % is not the problem, but really not sure). $sql="SELECT * FROM T WHERE f LIKE '%:bindParamString%'"; ...

Gettext: Translation of strings with HTML inside?

My current implementation, which is array based stores keys and values in a dictionary, example: $arr = array( 'message' => 'Paste a <a href="http://flickr.com/"&gt;flickr&lt;/a&gt; URL below.', ); I realize that it was probably a bad idea storing html inside of a string such as this, but if I'm using gettext then in my .mo/.po fi...

Auto converting data from a datetime field to a specific format in CakePHP

Hi is possible automatically to format (using date()) all data from a datetime field in CakePHP? I'm thinking about using a callback function in the model but I don't know if I could filter fields coming from a datetime type. Thanks in advance! ...

IE 7 textarea breaks between words

Hi all, I've got a LAMP site with a form that a user fills out. For some reason if viewing the returned form submission data on IE 7, it's inserting line breaks between each word. It's a pretty basic form with some input elements and a text area. If I submit the form with FF3+, IE8, or safari this isn't happening and everything looks f...

Does php have a built in coversion to base32 values?

I know I can use number_format, but is there a way to represent base32 numbers? For example, hex can be represented with 0x... and octal can be represented with a 0 in the front. Is there anything to represent base32 numbers in php? ...

How to display text bigger according to how many times entered into a MySQL database using PHP and MySQL?

Okay, I have this script that should display the tags that are entered more times bigger and tags that are entered less smaller for a certain question. But for some reason it displays the last tag entered bigger and displays all the tags that where entered before it smaller like if it was counting down. I need to fix this problem. I hop...

Why does AMFPHP store integers as two bytes for the AMF protocol?

I'm wondering if anyone familiar with AMFPHP or low level data storage could explain why integers are being stored as two bytes instead of four. As far as I can tell, the AMF3 protocol demands a four byte integer. The specific code in the serializer is the following: /** * writeInt takes an int and writes it as 2 bytes to the output ...

Get total memory usage for constructing a result set from a query

Is there a way to tell how much total memory MySQL used to construct a result set from a single query? What I'm looking for is something similar to php's memory_get_peak_usage(). I have a complex query that produces a few rows of summed data. The actual result set is tiny -- 6 or 8 rows of a floating decimal value. But the query I use ...

unexpected $end in php

Hello, I really can't find the error. Here is my code: <? // Action: add news if( array_key_exists('create_new', @$_POST) ) { ?> ... <? exit(); } ?> Before this my problem was in construction: <?=...;?> My apache doesn't understand it so that I rewrited code without that. But now I really can't find solution. ...

XSD transformation into XML

How can I create a (empty) XML file trough a existing XSD schema? Which PHP (5.3) functions are necessary? ...

Execute PHP via cron - No Input file specified

I'm using the following command to execute a PHP file via cron php -q /home/seilings/public_html/dvd/cron/mailer.php The problem is that I Have a file that's included in the execution that determines which config to load.... such as the following: if (!strstr(getenv('HTTP_HOST'), ".com")) { $config["mode"] = "local"; } else { ...

formvalidation with php and javascript/jquery?

im new in formavalidation. i am wondering if there is some library class you can download and include and then use for formvalidation in php and also in javascript/jquery? it would save a lot of time so you dont have to reinvent the wheel. thanks a lot in advance! ...

Best Practices: working with long, multiline strings in PHP?

Note: I'm sorry if this is an extremely simple question but I'm somewhat obsessive compulsive over the formatting of my code. I have a class that has a function that returns a string that will make up the body text of an email. I want this text formatted so it looks right in the email, but also so it doesn't make my code look funky. Her...

PHP function won't execute when called

Hi all, I'm having a problem with this function. It's supposed to echo out some stuff, but for some reason it won't do so when I call it. Here's the function: $count = count($info['level']); function displayInfo() { for ($i=0; $i<$count; $i++) { echo "[b]".$info['name'][$i]."[/b]\n\n" ."Level: ".$info['level'][$i] ."\nP...

What to do about storing user uploaded files in a Zend Framework application?

I'm creating a web application that will involve habitual file uploading and retrieval (PDFs, Word Documents, etc). Here are the requirements: need to be able to link to them in my view script so a user can download the files. files should not be accessible to users who are not logged in. Question #1: Where should I store these file...

Membership Application Database Model

I'm working on creating a membership-based web application. In order to become a member, you must fill out a lengthy membership application that qualifies your business. Once the application is complete, it goes to the admin of the site for approval. The application contains about 60 or so questions to be answered. Perhaps 25% of those q...