Search php

105013 results
2

votes
3

answer

Using php-ai/php-ml with php

I am using notepad++. I have installed composer and from command line I have tried to install the php-ai/php-ml using the following line of code composer require php-ai/php-ml. My cmd tells me that this is successfully installed and everything seems okay. However, in my index.php file if I try to u...
johnfish92
3

votes
1

answer

Embedding PHP inside PHP

I have recently put up a server, and I am making changes gradually. One of the changes is the contents of a php page. I commonly use a php "shell" (just a textarea and the php just evals what is written). I have made some changes and want to use fwrite($file, ""); but i am getting an error. I believ...
1

votes
1

answer

Echo php in php?

I would like to insert a PHP tag within a PHP tag in the example below: I would like to imprint the_title(); as the subject of the email. Can anyone offer any insight?
Jack Cash
1

votes
5

answer

PHP braces { } replace <?php ?>?

I've seen in someones source code they load template.tpl and inside is ...value="{$phcode}"... does {$phcode} replace I don't find any reference in php manual.
JohnDDdj
-1

votes
3

answer

PHP without <?php [duplicate]

Possible Duplicates: Are PHP short tags acceptable to use? How to enable PHP short tags? I came across some PHP code that is being used on a site. The odd thing is the php code is enclosed like this: not How can I get it to run on my server without the 'php' in there? take care, lee
Lee Loftiss
3

votes
3

answer

PHP rtrim “.php”

I want to remove ".php" from the end of a string if it exists. Consider this: $filename = 'index'; rtrim($filename,".php");//returns "index" $filename = 'search'; rtrim($filename,".php");//returns "searc" Why is this happening? I feel like it has something to do with ending with the letter 'h' - 'h'...
Joao
2

votes
3

answer

PHP require_once php path?

I'm trying to include PHP mailer but getting this error: the location of PHP Mailer is: and the php.ini file has that as the correct includes path: and that php.ini file is the one that PHPInfo() gave me. What am I missing here? Did I break PHP? Was everyone right about PHP all along? Am I a dup...
veta
3

votes
1

answer

PHP Caching (HTML + PHP)

I have made a framework for a project. The project does a medium amount of query requests (but the traffic it will be getting will make it more per user). The views are mixed HTML and PHP. Just looking for the best minimalist ways on how I should go about caching my view files (the controller uses o...
aibot
5

votes
4

answer

PHP error line 1: `<?php ?>'

I'm attempting to setup a very simple cron job on a web host. I have cron.php set to run every minute. Right now, for testing purposes, cron.php is simply this: And now, every minute, I'm receiving the cron email with these errors: //home/user/public_html/mysite/cron.php: line 1: syntax error near u...
Jake Wilson
5

votes
4

answer

PHP array vs PHP Constant?

I am curious, is there any performance gain, like using less memory or resources in PHP for: 50 different setting variables saved into array like this $config['facebook_api_secret'] = 'value here'; Or 50 different setting variables saved into a Constant like this define('facebook_api_secret', 'v...
JasonDavis
3

votes
4

answer

Remove .php extension with PHP

I could use some help here. I'm using this to fix my URL but I can't figure out how to remove the .php extension. The URL looks like this now: http://mydomain.com/page.php/foo/123/bar/456 function decode_URL_parameters() { $path = @$_SERVER['PATH_INFO']; $url_array=explode('/',$path); array_shift($u...
Tobias
-2

votes
2

answer

PHP: Open website in php

I need to open a fully working website in a php-file. The user doesn't have internet access but the server does. I'm currently using "file_get_contents" but that doesn't work for every website (for example facebook). It works for google, but non ascii characters can't be displayed as well as picture...
moritzg
1

votes
6

answer

Php problem eval/html/php

I've been writing a php/html page encoder/decoder... I know it already exists but it's a university project so go on XDDD I encode the pages that I want to protect let's say hypothetically with base64_encode and when I receive a request of any pages I have a loader that reads the coded page, decrypt...
Aliceiw
22

votes
6

answer

php form action php self

I have a php form like this.
Sasindu H
2

votes
0

answer

Install PHP CodeSniffer / PHP MessDetector

I am new to PEAR thing in PHP and I want to install PHP CodeSniffer & PHP MessDetector. I am using PHP Storm as my editor. My XAMPP installation directory is D i.e. D:\xampp\ I have downloaded CodeSniffer and Mess Detector and installed it manually (copy files and folders) under below location D:\xa...
Slimshadddyyy
1

votes
3

answer

php eTag generation using php

This PHP code generates an eTag for an xml file. The problem is eTag updates only when the file it self is updated/modified. I need the etag to update when the dynamic results are updated as well. any idea how this can be done? //get the last-modified-date of this very file $lastModified=filemtime(_...
apak
2

votes
1

answer

PHP WSO2's WSF/PHP

I am trying to use WSO2' WSF for PHP and I am using a WS Security object. I am making the request to the server and getting an Authentication error. I believe the WS Security Object is missing something, so I would like to see the RAW SOAP message being sent...Is there a way to do this. I am not d...
dorgan
2

votes
1

answer

“location ~ \.php$” or “upstrem php”?

I installed Wordpress with Nginx and php-fpm. I wrote in config file like location ~ \.php$ {} and it works. But some web site explains with upstrem php {}. What is the difference of these two expressions?
ironsand
3

votes
0

answer

PHP stream_resolve_include_path undefined php 5.5

While using XAMPP with PHP > 5.5, it throws an error : call to undefined function stream_resolve_include_path But, it is defined because if I try to inject my own function with the same name it throws : Cannot overwrite constant stream_resolve_include_path Anyone run across this problem in xampp? Or...
user2782001
6

votes
6

answer

Simulate PHP Include Without PHP

I want to include the same navigation menu on multiple pages, however I do not have PHP support, nor can I affect my server in any other way. I want to avoid simply copying and pasting the html onto all the pages as this would make updating the menu a pain. The two options I can think of are as foll...
dougmacklin
2

votes
2

answer

PHP Daemon in PHP 5.3

While the idea of a PHP daemon has been covered to death on here, I haven't found anything specifically related to how to do this in PHP 5.3. As I've been told, 5.3 introduced new garbage collection/memory management to allow PHP to more cleanly run as a daemon. I know PHP's no one's first choice fo...
fiiv
19

votes
17

answer

PHP templates - with PHP [closed]

What's the most elegant templating (preferably in pure PHP!) solution you've seen? Specifically i'm interested in handling: Detecting in a repeating block whether it's the first or last element Easy handling of odd/even cases, like a zebra striped table, or similar Other modulos logic, where you'd d...
David
2

votes
2

answer

PHP within an Echo PHP

I have the following code, but the echo $jsonData[$i] line gives an error. I know you are not supposed to execute PHP within PHP. What is the correct way to accomplish this? ');\" value=\"Chat Now\" class=\"success button small\" \" >'; } ?>
John Kim
2

votes
1

answer

PHP - First PHP site [closed]

This is my first PHP website that is actually going to be published. One of the items that I want to do is to create a slideshow inside my PHP page. I am not quite sure how to do this. I am hoping someone can give my some good source info. Also I understand this is a vague question but I am not su...
Michael Crawley
5

votes
4

answer

Diference between /../*.php and *.php

So I had this trouble with a PHP code that I solved, but I don't really know how it works. I tried to add this to every single file So I can only have one file to edit the navbar instead of the whole php files. The problem came up when I added that code to the files of another folder (ie. /general/v...
Axel Mtz
181

votes
3

answer

PHP “php://input” vs $_POST

I have been directed to use the method php://input instead of $_POST when interacting with Ajax requests from JQuery. What I do not understand is the benefits of using this vs the global method of $_POST or $_GET.
Lee
3

votes
3

answer

php - adding video to php

how can i add a ffplay.exe (ffmpeg) video to php script. can i use exec() to access the ffplay.
bharathi
5

votes
13

answer

Write PHP code in PHP

How can I write PHP code in PHP? I want to do this, but it doesn't work: Hope someone can give me a hint, Many thanks
David Lorenzana
6

votes
6

answer

PHP file_get_contents with php intact?

As opposed to using an include, which executes the included php in the file...is it possible to save the contents of a php file to a variable - but with the php still intact and executable? My goal looks something like: $template = some_imaginary_include_function('myfile.php'); foreach($list_of_blog...
johnnietheblack
3

votes
2

answer

PHP: STDOUT vs php://STDOUT

What is the difference between STDOUT and php://STDOUT in PHP? fwrite(STDOUT, ...); vs $StdOut = fopen('php://stdout', 'w'); fwrite($StdOut, ...);
Yousha Aleayoub
27

votes
7

answer

PHP multiline string with PHP

I need to echo a lot of PHP and HTML. I already tried the obvious, but it's not working: How can I do it?
Matt
2

votes
1

answer

PHP ActiveRecord for PHP < 5.3

I found RoR ActiveRecord very usefull. When I was looking for PHP version, I found this Unfortunately, the use of namespace cause it work only ini PHP > 5.3. Do anyone have alternative that work for > PHP 5.3?
iroel
3

votes
7

answer

PHP: Multithreaded PHP / Web Services?

Greetings All! I am having some troubles on how to execute thousands upon thousands of requests to a web service (eBay), I have a limit of 5 million calls per day, so there are no problems on that end. However, I'm trying to figure out how to process 1,000 - 10,000 requests every minute to every 5 m...
cappuccino
5

votes
10

answer

PHP - PHP Warning: PHP Startup: in Unknown on line 0

I installed apache2 and php 5.4.5. When you start apache this error: PHP Warning: PHP Startup: in Unknown on line 0 The extension does not work: ; extension = php_intl.dll ; extension = php_ldap.dll ; extension = php_oci8.dll ; extension = php_oci8_11g.dll ; extension = php_pdo_firebird.dll ; extens...
cmaxik
1

votes
1

answer

PHP SESSION VAR Exists but PHP message: PHP Notice:

I'm getting this error: [17-Oct-2014 08:46:12] WARNING: [pool blah.com] child 43657 said into stderr: "NOTICE: PHP message: PHP Notice: Undefined index: database_geo in /var/blah/site_profile.class.php on line 124" The error is for the following code and I've put a var_dump() in front of it with t...
Adam
3

votes
1

answer

Multiple PHP versions using phpenv, php-build and php-version

I'm on Arch Linux, trying to configure multiple PHP versions for testing my scripts. I'm basing myself on these three tools: https://github.com/phpenv/phpenv https://github.com/CHH/php-build/ http://wilmoore.com/php-version/ First I installed Apache and PHP (and their integration package) with pacma...
Henrique Barcelos
8

votes
2

answer

Migrating PHP serialization from PHP 5.3 to PHP 5.6

I have a complex structure that is saved in the MySQL database using the sericalize() function and then converted back using unserialize(). After migrating the system from PHP 5.3 to PHP 5.6 and unserializing in 5.6 the the data that was serialized on 5.3, the structures are corrupted. Certain ref...
Yirmiyahu Fischer
24

votes
10

answer

PHP - Application config file stored as - ini,php,sql,cached,php class,JSON,php array?

I am trying to decide on the best way to store my applications configuration settings. There are so many options. The majority of applications I have seen have used a simple require and a PHP file that contains variables. There seem to be far more advanced techniques out there. What have you used?...
Mark
1

votes
1

answer

Nginx 1.6.2 / PHP, limit website php to /

Warning: include(/functions.php): failed to open stream: No such file or directory in /home/sites/mywebsite/www/index.php on line 13 How to limit php to www website directory / so that it does not go back to /home/sites/mywebsite/www/ ? Nginx 1.6.2 - Debian 8 - PHP Version 5.6.30 - FPM/FastCGI
2

votes
3

answer

PHP works with <?php ?> and not with <? ?>

For some reason it seems to be working fine, only when I used tag. Does not work with What's wrong here?
X10nD