Dev Shed Forums - PHP Development http://forums.devshed.com/ PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm. en Thu, 18 Oct 2018 17:35:53 GMT vBulletin 60 http://forums.devshed.com/images/misc/rss.png Dev Shed Forums - PHP Development http://forums.devshed.com/ function() only has a return http://forums.devshed.com/php-development/981112-function-return-new-post.html Tue, 16 Oct 2018 01:46:11 GMT function($row) { return $row['date']; } 'Due Date' => $row['date'] ---------]]> This project was started before my brain surgery, so either I've forgotten what the intent was here, or the 2 lines below DON'T match. Anyone with a basic reminder/pointer? (Single item while building an array)
PHP Code:

'Due Date' => function($row) { return $row['date']; }
'Due Date' => $row['date'

]]>
PHP Development Triple_Nothing http://forums.devshed.com/php-development-5/function-return-981112.html
cURL in PHP http://forums.devshed.com/php-development/981101-curl-php-new-post.html Tue, 09 Oct 2018 16:22:37 GMT I have successfully used cURL to display PHP/MySQL reports from one domain on a web page on an entireIy different domain... works fine.

Now, I am trying to include an order form from one domain on a web page on a different domain. The "guts" of the order form is a file called "web_store_core.php" on domain1, where the data resides. The order form on domain2 is a simple shell page with the following cURL commands:

PHP Code:

<?php
$URL
="domain1/web_store_core.php?cust_id=7";
$ch curl_init();
curl_setopt ($chCURLOPT_URL"$URL");
curl_setopt($chCURLOPT_SSL_VERIFYHOSTfalse);
curl_setopt ($chCURLOPT_RETURNTRANSFER1);
curl_setopt ($chCURLOPT_FOLLOWLOCATION1);
$contents curl_exec($ch);
curl_close($ch);
// display file
echo $contents;
?>

As you would expect, the form in web_store_core.php is submitted when the order is placed. The problem is that when the form is submitted, the browser is looking for web_store_core.php on the calling domain (domain2) and not finding it.

The <form> statement in is as follows:
PHP Code:

<form method=\"post\" action=\"$_SERVER[PHP_SELF]\"> 

Is there a way that I can use cURL to make sure the form processing stays on Domain1 and does not look for it back on Domain2?

Thanks ]]>
PHP Development SeanF http://forums.devshed.com/php-development-5/curl-php-981101.html
Phalcon Issue http://forums.devshed.com/php-development/981066-phalcon-issue-new-post.html Wed, 26 Sep 2018 12:03:18 GMT Hi

I am having this issue when I am trying to run my project . I have enabled the mod_rewrite in httpd.conf but I made the .htaccess file
form the book I am reading. I am not getting the issue as its my first time using Phalcon .. here are the stuff

Apache LOG file
Code:

[Wed Sep 26 16:26:15.021982 2018] [mpm_winnt:notice] [pid 6888:tid 412] AH00456: Apache Lounge VC14 Server built: Jul 15 2018 10:55:21
[Wed Sep 26 16:26:15.021982 2018] [core:notice] [pid 6888:tid 412] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Wed Sep 26 16:26:15.026982 2018] [mpm_winnt:notice] [pid 6888:tid 412] AH00418: Parent: Created child process 3096
[Wed Sep 26 16:26:15.840029 2018] [ssl:warn] [pid 3096:tid 400] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Sep 26 16:26:16.027039 2018] [ssl:warn] [pid 3096:tid 400] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Sep 26 16:26:16.068042 2018] [mpm_winnt:notice] [pid 3096:tid 400] AH00354: Child: Starting 150 worker threads.
[Wed Sep 26 16:26:22.348401 2018] [core:alert] [pid 3096:tid 1780] [client ::1:2915] C:/xampp/htdocs/project1/.htaccess: <VirtualHost not allowed here
[Wed Sep 26 16:26:23.904491 2018] [core:alert] [pid 3096:tid 1776] [client ::1:2917] C:/xampp/htdocs/project1/.htaccess: <VirtualHost not allowed here
[Wed Sep 26 16:26:30.285857 2018] [core:alert] [pid 3096:tid 1780] [client ::1:2918] C:/xampp/htdocs/project1/.htaccess: <VirtualHost not allowed here
[Wed Sep 26 16:49:11.161849 2018] [core:alert] [pid 3096:tid 1780] [client ::1:3095] C:/xampp/htdocs/project1/.htaccess: <VirtualHost not allowed here
[Wed Sep 26 16:49:12.031899 2018] [core:alert] [pid 3096:tid 1776] [client ::1:3096] C:/xampp/htdocs/project1/.htaccess: <VirtualHost not allowed here
[Wed Sep 26 16:50:04.562909 2018] [core:alert] [pid 3096:tid 1776] [client ::1:3133] C:/xampp/htdocs/project1/.htaccess: <VirtualHost not allowed here
[Wed Sep 26 16:50:09.077168 2018] [core:alert] [pid 3096:tid 1780] [client ::1:3132] C:/xampp/htdocs/project1/.htaccess: <VirtualHost not allowed here
[Wed Sep 26 16:58:32.815037 2018] [core:alert] [pid 3096:tid 1776] [client ::1:3779] C:/xampp/htdocs/project1/.htaccess: <VirtualHost not allowed here


Error I am seeing when running the project
Code:

Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

If you think this is a server error, please contact the webmaster.

Error 500
localhost
Apache/2.4.34 (Win32) OpenSSL/1.0.2o PHP/7.0.31


.htaccess file
Code:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
</IfModule>

this file I made in apache folder name: project1.localhost.conf

Code:

<VirtualHost *:80>
DocumentRoot C:/xampp/htdocs/project1
DirectoryIndex index.php
ServerName localhost
ServerAlias C:/xampp/apache
<Directory C:/xampp/htdocs/project1.localhost/public>
Options All
AllowOverride All
Allow from all
</Directory>
</VirtualHost>

]]>
PHP Development ionezation http://forums.devshed.com/php-development-5/phalcon-issue-981066.html
CloudFlare Time-out http://forums.devshed.com/php-development/981044-cloudflare-time-new-post.html Wed, 19 Sep 2018 20:54:35 GMT I have a management system which is built using PHP/MySQL.

Some of the Scripts and database calls are fairly extensive and take longer than 100 seconds. The site is currently monitored by CloudFlare which has a rigid timeout after 100 seconds. If Cloudflare does not receive data from the server after 100 seconds it returns an ugly timeout page.

Is there a way to send some "in-progress" data to the browser while a PHP/MySQL script is running so that Cloudflare won't time-out?

Thanks ]]>
PHP Development SeanF http://forums.devshed.com/php-development-5/cloudflare-time-981044.html