Http://localhost/test.php

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

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?

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?

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

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

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/?

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?

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?

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

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

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

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?

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)

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?

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

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"

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

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?

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

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?

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

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?

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?

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?

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

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"?

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?

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]

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?

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?

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







Copyrights 2005-15 www.BigResource.com, All rights reserved