Http://localhost/test.php

Apr 22, 2003

I relatively new to PHP. Please help. I installed Apache, PHP. Then when I tried to test it by opening a test.php file with just the phpinfo() function in it doesn't execute the php file which is <? phpinfo(); ?>
instead, sends it for download and when I tried the same with a different filename like test.php3 or test.php4.

ADVERTISEMENT

Warning: Fopen(http://localhost/.. ?HTTP Wrapper Does Not Support Writeable Conn

Aug 17, 2007

I am able to create a pdf using php and ezpdf, its works fine, and display the pdf document in the current server page.

But here are two things i wish to do, first store the pdf and than open, if possible in a new popup window?

When i tried this function below, it gives me an error

Error:
Warning: fopen(http://localhost/pdf/files/tmp1/yasmina.pdf) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections. in C:Program FilesxampphtdocspdfpdfClassesAndFonts_009ecertificate.php on line 139
Could not open file to save PDF. Code:

View 2 Replies View Related

Test Paypal Api's From Localhost?

Apr 1, 2011

According to this site: [URL] It says that paypal cannot access locally hosted websites unless certain router ports are opened. Is this because the website is about IPN or is this true for all paypal api's?

On my laptop, I have a LAMP environmetn setup, when I use the http://localhost to create website before going live.

For a new project, I need to use the paypal api's. Will I be able to use the localhost to test the paypal api's if I connect my laptop to the internet? Or will I have to upload my website to a LAMP host elsewhere?

View 2 Replies View Related

JSON And Jquery - Test The Script Offline On Localhost?

Sep 8, 2010

I like to work with JSON and jquery. When I test the script offline on localhost it works fine, but when I change this json file to a server it doens't work al all

jQuery(function($) {
$.ajax
({

[code].....

View 1 Replies View Related

Send Mail To Outlook From Http://localhost

Mar 27, 2003

Does anyone know how to set up a script to send mails from http://localhost to your local mail client (Outlook, to be exact).

View 14 Replies View Related

Apache Not Recognising Http://localhost From Browser

Nov 22, 2005

I have been using a local installment of Apache web server and PHP on
my computer. For some reason it has stopped loading my local web pages
when I enter 'http://localhost' into the browser address bar. For IE it
displays a page not found and Netscape, it redirects me to Netscape
search where it does a search for 'localhost'. I cant understand why it
has been working and all of a sudden just stopped but is there anyway
to fix this in configuration? My knowledge of apache isnt the best so

View 3 Replies View Related

Setting Up CodeIgniter To Show Up On Http://localhost/ci/?

Apr 7, 2011

I downloaded and set-up CodeIgniter and Apache. I have started my Apache server, and in my config.php file in CodeIgniter, I set the base URL to:

$config['base_url'] = "http://localhost/ci/";

However, when I go navigate to that URL (http://localhost/ci/ or http://localhost/ci/index.php), I get a standard 404 Object not found error. When I navigate to localhost, I see the WAMP home page. Not sure if there is anything else I need to set up.

View 1 Replies View Related

Being On Or Off-line Can Affect Variable Transfer In Http://localhost?

Mar 28, 2003

Is there any trick that I should know about when trying to get php files to display in http://localhost?

I've been having trouble getting variables to pass from the php to the html page, but I swear it was working for a while there (couldn't believe it), but then, trying to figure out what had changed to make it work, I went on-line and all of a sudden, gone again. Variables not translating to the html.

Now I can't get it to work again, and I don't know why.

View 2 Replies View Related

Python To Make HTTP Request Internally/localhost?

Oct 8, 2010

ant to send some parameters from a python script on my server to a php script on my server using HTTP.

View 1 Replies View Related

Today.php Test Error. HTTP Headers

Jul 20, 2002

Trying to install on xp pro with IIS. Have mysql working. I tested it with the tutorial for installing from this forum.

When I open the test script, today.php I get
"The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are"' and theres is nothing after that but a black page.

The today.php consists of

<HTML><HEAD><TITLE>Today's Date</TITLE></HEAD><BODY><P>Today's Date (according to this Web server) is<?php
echo( date("l, F dS Y.") );
?></BODY></HTML>

Ive been over and over the php.ini and my.ini and cant figure it out.

View 1 Replies View Related

Passing Variable To Another File Error: Http://localhost/story.php?id=1

Sep 23, 2005

The script below (list.php) retrieves data from a database to list article titles. By clicking the hyperlink, the article text is supposed to appear when accessing story.php based on the $id variable passed through to the file "story.php". However I get this error msg when loading story.php.:

"Notice: Undefined variable: id in c:easyphpwwwstory.php on line 12."

Address line shows: http://localhost/story.php?id=1

This means that the list.php script works, since this shows in the address line.
However , the script which received the variable, does not recognize the id variable, why? Code:

View 3 Replies View Related

Access Test Site By Sending The Hostname Http Header To The IP Address

Jun 22, 2009

I am using a virtual host, so I have a shared IP address. I would like to access my test site by sending the hostname http header to the IP address, so the server can resolve the name and send back my site page. I am using an unregistered domain name on the server so I can't just type the url into the browser. Does anyone know the easiest way to set an HTTP header and send it to an IP address?

View 5 Replies View Related

Test Pages On XAMPP Without Typing "localhost / Mysites / Practice.php" And Just Clicking Html Icon?

Dec 22, 2010

How do I do this? It's not much of a hassle but at times it would be quite convenient if I could just double click on the php/html file to test my php scrips on my localhost/XAMPP server instead of the the double-click directing to me the location on the hard disk where the php server is not being used. I meant being able to skip typing the "localhost/" part of the file address in the browser address bar every time I want to test a php script.

View 5 Replies View Related

How To Use Http://www.mySite.com/test/ As The Base Domain (base Href)

Jan 20, 2006

how to use http://www.mySite.com/test/ as the base domain (base href)

with links relative to the site like this:

<a href="/faqs/overview.html">

Can mod rewrite do this?

View 1 Replies View Related

Test For "If-Modified-Since" HTTP Header Support?

Feb 5, 2010

Using PHP how can I accurately test that a remote website supports the "If-Modified-Since" HTTP header.From what I have read, if the remote file you GET has been modified since the date specified in the header request - it should return a 200 OK status. If it hasn't been modified, it should return a 304 Not Modified. Therefore my question is, what if the server doesn't support "If-Modified-Since" but still returns a 200 OK? There are a few tools out there that check if your website supports "If-Modified-Since" so I guess I'm asking how they work.

Edit: I have performed some testing using Curl, sending the following;

curl_setopt($ch, CURLOPT_HTTPHEADER, array("If-Modified-Since: ".gmdate('D, d M Y H:i:s GMT',time()+60*60*60*60)));
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_MAXREDIRS, 5);

[Code]...

View 3 Replies View Related

Remove "public/" From Http://localhost/myscript/public/ In Zend Framework

Sep 23, 2010

By default my script is accessible by using this url http://localhost/myscript/public/. But i need to access it by this url http://localhost/myscript/. How can i do this in Zend Framework.

View 3 Replies View Related

AJAX On Localhost Using IIS And It And MySQL - Error "A HTTP Error 404.3 - Not Found"

Jul 12, 2009

I am trying AJAX for the first time on my localhost. I am using IIS and PHP with MySQL. This error is generated: "A HTTP Error 404.3 - Not Found" when I try this javascript command: xmlhttp.send(null); xmlhttp is a varable and is used to retrieve the GetXmlHttpObject

View 1 Replies View Related

Something Simple!? Sessions - Admin.localhost To Main.localhost

Jul 16, 2005

Why does the following code allow me to keep the same session when in
the same sub domain (ie admin.localhost), yet not when I goto another
related domain eg main.localhost?

I would like to have the same session on the related domain. I bet
the solution is really simple <grin>!...

Using IE6. Win NT, Apache 1.3.27, PHP 4.3.2.

php.ini file - shown at end of message (apologies for length).. is
actually a copy of a PHP4.3.0 ini file (problem here?)

hosts file in windows:

127.0.0.1 localhost
127.0.0.1 admin.localhost
127.0.0.1 main.localhost

httpd.conf

setup for VirtualHosts
eg
ServerName admin.localhost.com

// session_test.php -- located in admin.localhost
<?
session_start();
echo "id is " . session_id();
?>
a href="http://admin.localhost/session_test1.php" next

a href="http://main.localhost/session_test2.php" next

// session_test1.php -- located in admin.localhost
<?
session_start();
echo "id is " . session_id();
?>

// session_test2.php -- located in main.localhost
<?
session_start();
echo "id is " . session_id();
?>

View 2 Replies View Related

Setting Test Items In CodeIgniter Unit Test Not Effecting Report Output?

Oct 13, 2010

I'm running CodeIgniter 2.0 and I have a test controller setup with this code in the index function. It seems like no matter what I put in the "set_test_items" variable, the report never changes. It always show all of the possible information regarding the test. I feel like I must be missing something blatantly obvious here. What am I missing?

$this->unit->set_test_items(array('test_name', 'result'));
$this->_test_user_lib();
$this->_test_user_model();
echo $this->unit->report();

Also, I just tried to var_dump() on the visible items when the report is generated and the array only contains the two things I passed in, so it is being set correctly.

View 1 Replies View Related

Unit Testing - Are There Any Open Source SimpleTest Test Cases That Test It's SPL Interfaces

Apr 27, 2010

I have quite a few objects in my system that implement the PHP SPL Iterator interface. As I write them I also write tests. I know that writing tests is generally NOT a cut 'n paste job.

But, when it comes to testing classes that implement Standard PHP Library interfaces, surely it makes sense to have a few script snippets that can be borrowed and dropped in to a Test class - purely to test that particular interface. It seems sensible to have these publicly available. So, I was wondering if you knew of any?

View 1 Replies View Related

Updating An Existing Site - Setting Up Test Space - Set The Base Test URL?

Oct 30, 2009

I'm just logging into a products based site which has been developed by someone else (third party), but now we need to take it over. I have currently copied all live files into a "test" directory so that the test version of the website can be accessed via [URL]. The problem with this is that I need to modify a few central scripts, including .htaccess, to refer to URLs and php included files using the /test/ rather than trying to access the live files. For example, .htaccess live code:

RewriteRule ^brands/([a-z0-9_-]+)/([a-z0-9_-]+)/?$ /scripts/brand_list.html?brand=$1§ion=$2&%{QUERY_STRING}

has been modified by me, to:

RewriteRule ^brands/([a-z0-9_-]+)/([a-z0-9_-]+)/?$ /test/scripts/brand_list.html?brand=$1§ion=$2&%{QUERY_STRING}

(notice the test directory in there) However, I am finding that I need to continue to update certain files - for example, now I need to update the template files so that their URLs, which are currently structured as follows:

/brands/tommy/

need to be changed to:

/test/brands/tommy/

I am just wondering if there is a better way to do this. Rather than updating the template files, is there a way in PHP (or .htaccess) to tell the entire site in my test directory to refer to all directories WITHIN the test directory? Maybe something like < base href > in HTML?

View 1 Replies View Related

PHPUnit - Running A Particular Test Suite Via The Command Line Test Runner

Dec 2, 2010

Is it possible to specify which test suite to run from a configuration file via the command line test runner? For example, if I have the following xml configuration:

<phpunit ...>
<testsuites>
<testsuite name="My Test Suite 1">
<directory>./MyTestSuite1/</directory>
</testsuite>
<testsuite name="My Test Suite 2">
<directory>./MyTestSuite2/</directory>
</testsuite>
</testsuites>
...
</phpunit>

Can I have it run only "My Test Suite 1"?

View 2 Replies View Related

Create A Separate Seed For Some Test Inside One Test Class?

Apr 30, 2010

How do I create a separate seed for some test inside one test class? PHPUnit documentation includes this example

<?php
require_once 'PHPUnit/Extensions/Database/TestCase.php';
class DatabaseTest extends PHPUnit_Extensions_Database_TestCase
{

[Code]....

But in this example I have one seed for all the tests inside my class.

View 1 Replies View Related

Write Unit Test To Test The Stack Functionality?

Apr 21, 2011

I want to write a unit test for a class handling a stack of positive integers. There are 4 methods in such class: push($x), pop(), getSize(), purge().

class Stack {
private $stack = array();
public function __construct() {
}
public function push($data) {
array_push($this->stack, $data);
}
public function pop() {
return array_pop($this->stack);
[Code]....

View 1 Replies View Related

PHPUnit Test - Unit Test Class?

Jan 20, 2010

I'm trying to get into Unit testing for the obvious positives it introduces, and I'm trying to write a Unit test for a class I wrote the other day. (I know this is the opposite to TDD, please bear with me) My class, Image, is used in conjunction with some others for image manipulation. Image essentially wraps a GD image resource and stores data along with it. For example, an instance of Image will always contain it's current state, i.e. its new width/height if resized, the original image data, etc. The Image class also contains methods for,

Creating itself from a file, string data, or URL, e.g. $image->loadFromPath() Creating a new GD image resource from the properties of the current Image instance, e.g. for image resizing to maintain background transparency, etc. Cloning the GD image resource for use in the manipulation classes

What I'm struggling with is how to Unit test this class properly with PHPUnit. I've done some reading and I have a few conflicting ideas on how to approach it and I don't know what's right. Do I, Write a test for each method of the class. I read somewhere that I should test each and every method. However, some of the methods run others (rightly so may I add), so you then have a chain of dependency.

But I also read that each Unit test should be independent from the other. So what do I do if this is the case? Write each test as a usage route of the class. I also read somewhere that each test should instead represent 1 path/usage route you can take with the class. Therefore if you cover every usage, you'll ultimately get complete code coverage.

View 3 Replies View Related

Why Does Filter_var($email - FILTER_VALIDATE_EMAIL) Allow Test@test

Aug 4, 2010

I was just setting up the validation for a form in which I decided to try using the filter_var function to check the validity of my email address. I can not find out what filter_var actually allows anywhere though (since the documentation is very simple), and I found out that it is allowing an email address like test@test. Doesn't there have to be a .com, .net etc... in the domain?

View 4 Replies View Related

Zend Studio 7.1 Unit Test Case Wizard Does Not Populate "Element To Test"?

Dec 24, 2009

When I follow the instructions in ZS documentation to create a phpunit test case, the wizard returns no objects to select on the "Element to Test" line. Selecting "browse" provides an empty dialog box. The PHPUnit path in my preferences shows "/Applications/zend/zs710/plugins/com.zend.php.phpunit_7.1.0.v20091120-0900/resources/library/". What else can I check to see why I cannot create a test case? I'm new to ZS and PHP, so I have no idea how to troubleshoot this.

View 2 Replies View Related

Test AssertArrayHasKey And Later Test Value Using AssertEquals?

Jul 5, 2011

Does it make sense to test assertArrayHasKey and later test it's value using assertEquals, or when I'm expecting specific value, I should ommit testing testArrayHasKey - I will get "Undefined index: id" in the next assertion anyway. I'm aware that difference is in feedback (F vs. E) but does it make any difference in real life?

View 1 Replies View Related

Test "included" Classes - No Runnable Test Cases In [index.php]

Nov 26, 2010

I have de follow code:

include 'simpletest/autorun.php';
include 'config_test.case.php'; // <-- problem

But it not works. I get:

Bad TestSuite [index.php] with error [No runnable test cases in [index.php]]

But if I put the Config class code directly (no "include"), it works.

View 1 Replies View Related

Differents Between $GLOBALS["test"] And Global $test?

May 22, 2010

can any one please let me know the basic differences between

$GLOBALS["test"] and global $test

and, will it make sense that, if i use $GLOBALS["test"] instead of $_SESSION['test']?

View 2 Replies View Related

CURL - Post Xml Data To A Test Page.on My Test Page?

Apr 15, 2009

I have the below curl that post xml data to a test page.on my test page when i try and see what has been posted via print_r($_POST) i only see the the root element and nothing more?how can i get the xml file i am posting or see what i am posting?

my curl to post

PHP Code:

<?php
    /**
* Define POST URL and also payload
     */
/* define('XML_PAYLOAD', "<?xml version='1.0'?><member><name>name</name><last>last</last></member>");[code].....

View 24 Replies View Related

Uncaught SoapFault Exception: [HTTP] Error Fetching Http Headers

May 28, 2009

I'm trying to create a soap connection to Magento's web services, however I'm getting an error when I try and create an instance of the soap client class. I can view the wsdl file in firefox without problems and I can watch php make the request for the wsdl in apaches logs but it still fails. Nusoap can connect.

$proxy = new SoapClient('someaddress?wsdl');

The error is

<b>Fatal error</b>: Uncaught SoapFault exception: [HTTP] Error Fetching http headers in /home/sites/xxx/xxx_main/system/application/views/contentpage_templates/gift_service.php:29

Stack trace:

[internal function]: SoapClient-&gt;__doRequest('&lt;?xml version=&quot;...', 'http://cornishw...', 'urn:Mage_Api_Mo...', 1, 0)
[internal function]: SoapClient-&gt;__call('call', Array)
/home/sites/xxx/xxx_main/system/application/views/contentpage_templates/gift_service.php(29): SoapClient-&gt;call(NULL, 'catalog_categor...', 5, 'giftshop')

[code]....

View 8 Replies View Related

Extensions Not Found : HTTP Error 502.2 - Bad Gateway The Specified CGI Application Misbehaved By Not Returning A Complete Set Of HTTP Headers?

Jul 3, 2009

PHP keeps failing and telling me that its not finding the /ext/php_mssql.dll for some reason. Obviously, I checked the folder and it is very much there. I'm not sure why it is failing.

EDIT:I put the ntwdblib.dll into my php directory and the error that was giving went from "bad gateway. the specified cgi application misbehaved by not returning a complete set of http headers.the headers it did return are "php failed to start: could not load /ext/php_mssql.dll" to not returning any headers at all.

HTTP Error 502.2 - Bad Gateway The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are "".

View 2 Replies View Related

SoapFault Exception: [HTTP] Error Fetching Http Headers?

Jan 28, 2011

I am getting following exception in my php page.SoapFault exception: [HTTP] Error Fetching http headersI read couple of article and found that default_socket_timeout needs configuration.so I set it as follow.

default_socket_timeout = 480

I am still getting same error.

View 1 Replies View Related

Edit Mail Server From Using Localhost - Mail() Go Around Localhost

Dec 8, 2010

I'm currently working on a website. I've done all the code its just that i cant send emails via my WAMP server becouse the mail function only support 32bit operating system. Wich means I'm trying to edit my mail server from using localhost/ to like hotmail.com (example) I have googled alot, for like 2-3 days but didn't find what i was looking for. Btw. Last time i was active was when i were like 12 yrs old and annoyed the shit out of people on the C++ forum with my scripts. Don't blame me, blame the 12yr old in me. Sry about that, i just wanted to say it.

View 6 Replies View Related

Calling Localhost Site From Another Localhost Site Using CURL?

Dec 7, 2010

I am trying to call a site on localhost from another also on localhost using CURL in PHP. (It's a test)

I'm using windows 7

Both are set up in the host file and work fine if accessed directly

I get a 404 error. If I call a site on the web then it comes back fine.

protected function get($url)
{
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);

[Code]....

View 1 Replies View Related

Regex That Matches URLs With/without Http:// Or Www. Or Http://www. In A Text?

Aug 9, 2010

I've been trying to find a solution myself but I couldnt do it so far (even tried all, so:Need a regex that matches URLs like (PHP code):

[URL].....

View 2 Replies View Related

Create HTTP Server Push (also Known As HTTP Streaming)?

Dec 20, 2009

How to create HTTP server push (also known as HTTP streaming) with PHP (better streaming video)?

View 1 Replies View Related

Server HTTP Sends Or Streaming HTTP?

Jul 10, 2001

I was wondering if you guys had any ideas to constantly
stream a webpage in case an announcement was posted
or possibly pushing onto the browser information.

What I basically want is for a user browsing my website
to be notified of any new announcements. I thought
about checking everytime he changes pages but then
I realized that I want them to be notified as long as
they have the page open even if it's minimized. So it
would at best be a method to use php force send a msg
after someone posts an announcement.

View 1 Replies View Related

Questions About HTTP Headers Sent With PHP In HTTP Authentication

Jul 4, 2007

Here is an example from the PHP Manual

<?php

if ((!isset($_SERVER['PHP_AUTH_USER'])) || (1==1)) {
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
echo 'Text to send if user hits Cancel button'
exit;
} else {
echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>";
echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</
p>";
}
?>

Questions.

1. This is a status code not a header, right? = header('HTTP/
1.0 401 Unauthorized');

2. According to the change log in the PHP manual, starting with 4.4.2
and 5.1.2 the header function now prevents more than one header to be
sent at once as a protection against header injection attacks. Does
this mean if I make multiple header calls the headers will be sent in
multiple response messages to the browser? Is this allowed? Can a
server send multiple response messages to one request?]

3. If you hit the "cancel" button on the browser user name/password
request dialog (as alluded to in the code snippet above), what message
does the browser send to the server.

View 3 Replies View Related

Add A 301 Redirect To Move All Access From Http://a.com To Http://www.a.com

Aug 26, 2007

I'm currently using the following .htaccess code:

RewriteEngine on
RewriteBase /
ReWriteRule .htaccess [F]
RewriteRule ^([a-zA-Z0-9/-]+)$ index.php?url_path=$1

And I'd like to add a 301 redirect to move all access from http://example.com to http://www.example.com. How can I do it, keeping the current rewrite rule?

View 3 Replies View Related

Get The HTTP Request As A String From HTTP Stream?

Apr 4, 2011

I'm using PHP Streams to make HTTP calls with fopen(). I would like print the HTTP request as a string (headers and content) before it is sent via fopen().

Is there a function that handles the stream context variable to do this?

Here is a function that expects a URL, fetches it and returns the content:

function do_post_request ($url, $content, $cookie = null) {
$headers = array("Content-type: application/x-www-form-urlencoded",
$cookie);
$all_headers = implode("
", $headers)."

[Code]....

View 1 Replies View Related

Run Selenium Server To Test My Selenium Test Cases?

Jun 29, 2011

I have just installed Selenium server and java on my system and tried to run selenium test case which i have created using Seleniun IDE but i did not get any result from selenium server.

View 1 Replies View Related

Trapping A File Error: Failed To Open Stream: HTTP Request Failed! HTTP/1.1 404 Not Foundin

Nov 3, 2006

php
Warning: file(http://shop1.outpost.com/product/5053975)
[function.file]: failed to open stream: HTTP request failed! HTTP/1.1
404 Not Foundin

I am just trying to put some code around this to trap it.

View 1 Replies View Related

Http - Send HTTP GET Request To URL?

Jun 6, 2009

I'm planning to use PHP for a simple requirement. I need to download a XML content from a URL, for which I need to send HTTP GET request to that URL.How do I do it in PHP?

View 5 Replies View Related

ADVERTISEMENT