Jump to content

Need help writing to an HTML file using base tags


eldan88

Recommended Posts

Hey Guys. I am trying to write to an HTML and attach that file for an efax API. One of the file types they accept is HTML, but it has to be in a <base> tag format. I am a little confused on how to do that. I tried to use fopen with the base tag but it didn't seem to work for me. I got the following error

 

Warning: fopen(<base a href='96401.html'></base>) [function.fopen]: failed to open stream: No such file or directory

 

Ideally what I am trying to accomplish is creating a file that just says 96401.html.

 

Below is the code that I have tried it with. Any help would be really appreciated!!!

$orderFile = "<base a href='".$id.".html'></base>"; // File name to be created. order id is used as a file name e.g. 123456.html
	//$fh = fopen($orderFile, 'w') or die("can't open file"); // Create and Save the writeable File
	//fwrite($fh, $order_information); // Write email contents to created file.

you need to specify a file path for fopen, not the content.

It will attempt to create the file if it does not exist and you use 'w' as the second argument.

 

$fp fopen('data.txt''w');
fwrite($fp'1');
fwrite($fp'23');
fclose($fp);

 

http://www.php.net/manual/en/function.fwrite.php

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.