PHP - Fopen Appending Issue
Hi! Thank you in advance for the time and assistance.
I am writing a form and some php code that writes to a text file. I have that accomplished. My issue is that my form that writes to the text file appends to the bottom of the text file and I need it reversed. The latest form entry needs to be on top... and then the older posts to follow. I have tried the w+ r+ and c+ but that is not doing it. Is there something that I am missing? I appreciate the assistance! Mike Similar Tutorialshi, I want to write pdf file but it is getting garbage value i check following url http://bugs.php.net/bug.php?id=21904&edit=1 Code: [Select] $fp = fopen($fdirandname,'wb'); fwrite($fp,$pdfcode); fclose($fp); So I am tryting to create a script to upload a CSV file into a MySql DB. It has like 10K records into SQL
My Code is copy below ...
I get the following errors.
Line 16 is the $handle
line 18 is the While Statement
Error:
Warning: fopen(): Filename cannot be empty in C:\local\htdocs\ADPStorage\DemandCSV.php on line 16 Warning: fopen()expects parameter 1 to be resource, boolean given in C:\local\htdocs\ADPStorage\DemandCSV.php on line 18 I use my script for another table and it worked like a charm. Less data and less colums do. Bad Code: (good Code sample below. this one) <?php $today = date("m.d.y.h.m.s"); echo $today; $BPTD_fy = '2014'; $BPTD_updatedate = $today; $conn = mysql_connect("Localhost","root","password") or die (mysql_error()); mysql_select_db("ds_storage",$conn); if(isset($_POST['submit'])) { $file = $_FILES['file']['tmp_name']; $handle = fopen($file, "r"); while(($fileop = fgetcsv($handle, 100000, ",")) !==FALSE) { $BPTD_fy = $fileop[0]; $BPTD_Status = $fileop[1]; $BPTD_Classification = $fileop[2]; $BPTD_ProcureCat = $fileop[3]; $BPTD_Product = $fileop[4]; $BPTD_Project = $fileop[5]; $BPTD_DSCategory = $fileop[6]; $BPTD_Calculated = $fileop[7]; $BPTD_CapacityType = $fileop[8]; $BPTD_Amount = $fileop[9]; $BPTD_Jul = $fileop[10]; $BPTD_Aug = $fileop[11]; $BPTD_Sep = $fileop[12]; $BPTD_Oct = $fileop[13]; $BPTD_Nov = $fileop[14]; $BPTD_Dec = $fileop[15]; $BPTD_Jan = $fileop[16]; $BPTD_Feb = $fileop[17]; $BPTD_Mar = $fileop[18]; $BPTD_Apr = $fileop[19]; $BPTD_May = $fileop[20]; $BPTD_Jun = $fileop[21]; $BPTD_Location = $fileop[22]; $BPTD_Env = $fileop[23]; $BPTD_Requester = $fileop[24]; $BPTD_ServiceArea = $fileop[25]; $BPTD_ServiceGroup = $fileop[26]; $BPTD_DepHead = $fileop[27]; $BPTD_Recgroup = $fileop[28]; $BPTD_RecOwner = $fileop[29]; $BPTD_Entrydate = $fileop[30]; $BPTD_updatedate = $fileop[31]; $sql = mysql_query("INSERT INTO inv_bpt_demand (Status, Classification, ProcureCat, Product, Project, DSCategory, Calculated, CapacityType, Amount, Jul, Aug, Sep, Oct, Nov, Dec, Jan, Feb, Mar, Apr, May, Jun, Location, Env, Requester, ServiceArea, ServiceGroup, DepHead, Recgroup, RecOwner, Entrydate, updatedate) VALUES ('$BPTD_Status', '$BPTD_Classification', '$BPTD_ProcureCat', '$BPTD_Product', '$BPTD_Project', '$BPTD_DSCategory', '$BPTD_Calculated', '$BPTD_CapacityType', '$BPTD_Amount', '$BPTD_Jul', '$BPTD_Aug', '$BPTD_Sep', '$BPTD_Oct', '$BPTD_Nov', '$BPTD_Dec', '$BPTD_Jan', '$BPTD_Feb', '$BPTD_Mar', '$BPTD_Apr','$BPTD_May', '$BPTD_Jun','$BPTD_Location', '$BPTD_Env','$BPTD_Requester', '$BPTD_ServiceArea', '$BPTD_ServiceGroup','$BPTD_DepHead', '$BPTD_Recgroup','$BPTD_RecOwner','$BPTD_Entrydate','$BPTD_updatedate')"); if($sql) { echo 'Data Uploaded Successfully'; } } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>BPT Demand CSV</title> <link rel="stylesheet" type="text/css" href="file:///C|/local/htdocs/style/style.css" /> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> </head> <body> <div id="mainWrapper"> <form method="post" action="https://localhost/Storage/DemandCSV.php" enctype="multipart/form-data"> <input type="file" name="file" /> <br /> <input type="submit" name="submit" value="Submit" /> </form> </div><!--end mainWrapper--> </body> </html>Similar Working code (good) <?php $conn = mysql_connect("Localhost","root","password") or die (mysql_error()); mysql_select_db("ds_storage",$conn); if(isset($_POST['submit'])) { $file = $_FILES['file']['tmp_name']; $handle = fopen($file, "r"); while(($fileop = fgetcsv($handle,1000,",")) !==FALSE) { $PC_Num = $fileop[0]; $PC_Name = $fileop[1]; $PC_BPTNUM = $fileop[2]; $PC_busclass = $fileop[3]; $PC_Note = $fileop[4]; $PC_Acro = $fileop[5]; $PC_type = $fileop[6]; ///echo $fileop[1]; $sql = mysql_query("INSERT INTO inv_names (PC_Num, PC_Name, PC_BPTNUM, PC_busclass, PC_Note, PC_Acro, PC_type) VALUES ('$PC_Num', '$PC_Name', '$PC_BPTNUM', '$PC_busclass', '$PC_Note', '$PC_Acro', '$PC_type')"); if($sql) { echo 'Data Uploaded Successfully'; } } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Upload CSV</title> <link rel="stylesheet" type="text/css" href="file:///C|/local/htdocs/style/style.css" /> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> </head> <body> <div id="mainWrapper"> <form method="post" action="https://localhost/Storage/Storage_CSV.php" enctype="multipart/form-data"> <input type="file" name="file" /> <br /> <input type="submit" name="submit" value="Submit" /> </form> </div><!--end mainWrapper--> </body> </html>Please help and thx in advance ~J I am trying to append data to a variable through each loop of a MySQL array, but I am doing it wrong. Is this possible? Here is the code. $html = <<<TABLE <table border = "1" align = "center"> TABLE; //// Get Endorsement Info $endo = mysql_query("SELECT * FROM endorse WHERE endonum = '$endonum' AND agency = '$agency' ORDER BY ID DESC LIMIT 1"); while($endofetch = mysql_fetch_array($endo)){ $endotype = $endofetch['type']; $typeid = $endofetch['typeid']; $change = $endofetch['changetype']; $info = mysql_query("SELECT * FROM $endotype WHERE ID = '$typeid'") or die(mysql_error()); $infoout = mysql_fetch_array($info); $date = date("m/d/Y g:i a", strtotime($endofetch['date'])); if($endotype == "drivers"){ $firstname = $infoout['firstname']; $lastname = $infoout['lastname']; $licnum = $infoout['driverslic']; $vyear = $infoout['year']; $vmake = $infoout['make']; $vmodel = $infoout['model']; $vvin = $infoout['year']; $html .= <<<TABLE <tr> <td>Endorsement Request Date:</td><td>{$date}</td> </tr> <tr> <td>Change Requested:</td><td>{$change} Driver</td> </tr> <tr> <td>Driver Info:</td><td>{$firstname} {$lastname} </td> </tr> <tr> <td>License Number:</td><td>{$licnum}</td> </tr> <tr> <td>Signature __________________</td><td>Date:_____________</td> </tr> TABLE; } if($endotype == "vehicles"){ if($change == "Delete"){ $veyear = $endofetch['year']; $vemake = $endofetch['make']; $vemodel = $endofetch['model']; $vevin = $endofetch['vin']; $html .= <<<TABLE <tr> <td>Endorsement Request Date:</td><td>{$date}</td> </tr> <tr> <td>Change Requested:</td><td>Delete Vehicle</td> </tr> <tr> <td>Vehicle Info:</td> </tr> <tr> <td>Year:</td><td>{$veyear}</td><td>Make:</td><td>{$vemake}</td><td>Model:</td><td>{$vemodel}</td> </tr> <tr> <td>Vin Number:</td><td>{$vevin}</td> </tr> <tr> <td>Signature __________________</td><td>Date:_____________</td> </tr> TABLE; } else { $html .= <<<TABLE <tr> <td>Endorsement Request Date:</td><td>{$date}</td> </tr> <tr> <td>Change Requested:</td><td>{$change} Vehicle</td> </tr> <tr> <td>Vehicle Info:</td> </tr> <tr> <td>Year:</td><td>{$vyear}</td><td>Make:</td><td>{$vmake}</td><td>Model:</td><td>{$vmodel}</td> </tr> <tr> <td>Vin Number:</td><td>{$vvin}</td> </tr> <tr> <td>Signature __________________</td><td>Date:_____________</td> </tr> TABLE; } } } $html .= <<<TABLE </table> TABLE; echo $html; This code is for creating a PDF with fpdf and a third party table class. Its only displaying the last table data in the loop when I echo $html so the data is being overwritten each loop. Hello everybody! Keep in mind I'm new to PHP but get the basics I'm trying to collect email addresses from a web-form that gets filled out on a website into a simple txt file on the server. The problem is the emails get appended one right after the other with no spaces so it looks like "user@server.comuser2@server.comuser3@server.com" and so on. What I'm trying to do is either separate them by a comma, or put them on a new line but whatever I try, it will not accept it. Anyway, here is the code that I have: Code: [Select] $fp = fopen("/home/fullertr/public_html/email_collector.txt","a"); fwrite($fp,$_POST['visitormail' . "\n"]); fclose($fp); unset($_POST); Thanks for any help! Hi Guys Again, another noob question that I can't seem to find a concise answer to. What is the best way to append a query string to a url? I've tried using the Header() function but this didn't seem to work - i.e. Code: [Select] Header("Location: enc.php?ID=test"); My goal is to change the query string depending on the output of various if else statements. For instance if $test isset then execute some code. The script will be self contained so it'll be posting back to itself with the query string and reacting differently depending on the query string. Any ideas? PS sorry if i am asking too many questions. Eager to learn and struggling to find answers to some things. What I basically want to do (and not sure if this is possible) is to append a different query string based on Hi, I have the following code which allows a user to enter a name for a mysql column field. Once they have submitted the form they are then redirected back to the form which allows them to enter the name for another mysql column form. When they are returned to the form, I would like the new column field added to the file named userinfo.php The problem is, I need the column field variable entered into the userinfo.php in the following format $newcolumn = $info['newcolumn'] but when I put it like this $stringData = "$newcolumn = $info['newcolumn']"; I get this error Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/tropicsb/public_html/MemberSiteMaker/admin.php on line 398 Code: [Select] // Profile and Application details case "profileFields": session_start(); if(isset($_SESSION['username'])) { $newcolumn = $_GET['newcolumn']; $file = "lib/userinfo.php"; $fh = fopen($file, 'a') or die ("Cant open file"); $stringData = "$newcolumn = $info['newcolumn']"; fwrite($fh, $stringData); fclose($fh); echo "This is the logged in page\n<br>"; ECHO <<<PAGE <form action=admin.php?cmd=addfield&username=admin method=POST> <input type=text name=newcolumn> <input type=submit name=submit> PAGE; } else { echo "This is a failed login"; } break; case "addfield": include_once("data/mysql.php"); $newcolumn = $_POST['newcolumn']; $mysqlPassword = (base64_decode($mysqlpword)); $con = mysql_connect("$localhost", "$mysqlusername", "$mysqlPassword") or die(mysql_error()); mysql_select_db("$dbname", $con) or die(mysql_error()); $result=mysql_query("ALTER TABLE members ADD $newcolumn VARCHAR(30) AFTER approved") or die("Alter Error: ".mysql_error()); mysql_close($con); echo "Database has been modified successfully."; echo '<meta http-equiv="REFRESH" content="5;url=admin.php?cmd=profileFields&username=admin&$newcolumn">'; break; thanks Hi all I am trying to loop through an array and output as JSON. What I'm looking to do is create something like: Code: [Select] "something": [ {"title":"Test 1"}, {"title":"Test 2"} ], Notice that the final row has no comma. My code is as follows: <?php foreach($something as $thing): ?> <?php $something_array = array('title'=>$thingt->getId()); ?> <?php echo json_encode($something_array).','."\n"; ?> <?php endforeach; ?> I had to add a comma to the end of the array, or the JSON rows would not be ended with one. How can I get it so that, no matter how many items are in the array, the last row, wil not have the comma at the end? With the comma at the end, my JSON doesn't validate Thanks [/code] Hello. I'm trying to append the loop keys and values into a string and store it into a hidden field. This is the code I have : Code: [Select] if (isset($_POST['ordered'])) { // We can assign $_POST['product'] to a variable to make it easier to type out $prod = $_POST['product']; // Throw a little intro to see how many they checked echo 'You selected ' , count($_POST['ordered']) , ' products.'; // Now we loop through it and get the IDS that were selected // Foreach lets you select the $key and the $value for each iteration of the loop // $strOrder = ""; foreach ($_POST['ordered'] as $key=>$id) { echo '<p/> ProdName: ' , $prod[$id]['name'] , '<br/> ProdPrice: ' , $prod[$id]['price'] , '<br/> ProdQty: ' , $prod[$id]['qty'] , ' <hr/>'; $strOrder .= $key . " " . $id; $TOT += $prod[$id]['price'] * $prod[$id]['qty']; } $TOT2 = $TOT + 55; echo '<input type="hidden" Name="TOT" value ="'. $TOT .'">'; echo '<input type="hidden" name="TOT2" value =". $TOT2 .'">'; echo '<input type="hidden" name="Order" value=". $strOrder . '">'; } strOrder does not get set to a value. I have an array of $fl By using values of this array, i want to create a new string. I need string size will be maximum 200 characters. When i try below code snipped, $f value is added to string two times. How can i add $f to array only one time, with checking size of string. Thank you Code: [Select] $fl=getsomelist(); // gives an array $userList=''; foreach ($fl as $f) { if ( strlen($userList .= $f) <= (200) ) { $userList .= $f; } else { break; } } can someone give me a push here? I've tried "file_put_contents" and "fputs" and neither one works for me. I'm running PHP on an IIS server and a windows hosting plan. PHP version is 7.3.1 I believe. here is my code: if ($validation = "true") { file_put_contents("ValidationsRedeemed.txt", $validationKey . "|", FILE_APPEND); //$handle = fopen("ValidationsRedeemed.txt", "a"); //fwrite($handle, $validationKey . "|"); //fclose ($handle); } else { //user entered a product key that is not recognized. tell them to try again. echo "<script>alert('The product key entered is not valid.'+'\\n\\n'+'Please try again.'); window.location.href='test.php';</script>"; } thanks! Hey guys This is the first loop i have attempted on my own, so please tell me if ive done something completely stupid.. What happens is the suer specifies a number of thumbnails on the previous page, these are posted to the form and then that amount of thumbnails should be displayed. Heres what i have so far $cd = 0; while ($cd < $numberofthumbnails) { $displaythumbs . '<div class="ThumbnailHolder"> <div class="LeftThumb"><a class="group" href="../../../Images/Lighthouses/Beachy-Head/1.png"><img src="../../../Images/Lighthouses/Beachy-Head/Mini/Thumbnail-1.png" width="430" height="200" alt="Thumbnail 1"></a></div> <div class="RightThumb"><a class="group" href="../../../Images/Lighthouses/Beachy-Head/2.png"><img src="../../../Images/Lighthouses/Beachy-Head/Mini/Thumbnail-2.png" width="430" height="200" alt="Thumbnail 2"></a></div></div> '; $cd++; } Essentially what im trying to do is as thumbnail code to $displaythumbs for each time the loop goes round. What am i doing wrong? Thanks Danny. Hi,
what I'm tryng is to append a table row with associated jquery code...
I have a jquery code just like this
<script type="text/javascript"> jQuery(function($) { var rowCtr = 0; $('.addRow').click(function(){ $('#tableID > tbody:last').append('<tr name="rowEq['+rowCtr+']" id="rowEq['+rowCtr+']"><td>'+ '<select id="stype'+rowCtr+'" name="rowData['+rowCtr+'][equipment_type]">'+ '<option value="0"> -- </option>'+ '<option value="1"> Type 1 </option>'+ '<option value="2"> Type 2 </option>'+ '<option value="3"> Other </option>'+ '</select>'+ '<input id="other_type'+rowCtr+'" type="text" name="rowData['+rowCtr+'][other_type]">'+ ); $('#stype'+rowCtr).change(function() { if(jQuery('#stype'+rowCtr).val() == '3') { jQuery('#other_type'+rowCtr).show(); }else{ jQuery('#other_type'+rowCtr).hide(); } }); if(jQuery( '#stype'+rowCtr ).val() != '3') { jQuery('#other_type'+rowCtr).hide(); } rowCtr++; }); }); </script>And html like this.. <input type='button' class='addRow' value="Add Row"> <form> <table id="tableId"> <thead> <tr> <th> Type </th> </tr> </thead> <tbody> <tr> <td> dummy text.. </td> </tr> </tbody> </table> </form>The appending is ok but the hidding/showing of "other_type" field is not working. It always hide "other_type" field even if I already selected the 'other' option. tbl1.png 3.38KB 0 downloads Hey all, I have two objects that contain object instances. I want to compare the properties of the instances and if the old_parent's property doesn't exist as one of the $new_parent's property, then I place the old_parent's property in an array called unneeded_ids. Problem is when I use nested foreach to loop through the instances of the two objects, despite old_parent having only one instance with a property id of 1, because it loops twice, the array gets two "1" values rather than just one: Code: [Select] public function update(){ $vanity_url = new VanityUrl(); $vanity_url->where('user_id',$this->current_user()->id)->get(); $zones = $this->input->post('zones'); $zone = new Zone(); $zone->where_in('name', $zones)->get(); $subcategory = new Category(); $subcategory->where('id',$this->uri->segment(4))->get(); $old_parents = new Category(); $old_parents = $subcategory->related_category->get(); $unneeded_ids = array(); if(!$this->input->post('catupload')){ if($subcategory->save($zone->all)){ redirect("blogs/$vanity_url->url/categories"); } else { echo "Error occurred. Please try again."; } } else { $new_parents = new Category(); $controller = $this->input->post('catupload'); $new_parents->where_in('controller',$controller)->get(); foreach($new_parents as $new){ foreach($old_parents as $old){ if($new->id != $old->id){ array_push($unneeded_ids, $old->id); } } } var_dump($unneeded_ids); } } The var_dump outputs: Code: [Select] array(4) { [0]=> int(126) [1]=> int(127) [2]=> int(126) [3]=> int(127) } but it should only output: Code: [Select] array(2) {[0]=> int(126) [1]=> int(127)} That's because there's only one object instance of old_parent that has a property id value of 126 and the same for 127. The nested for each loop is causing it to iterate twice against the same object and sticking it into the array. How do I get desired result? Thanks for response. Hey all i am attempting to connect to a ftp address and display the contents of a file into a textarea and i keep getting errors is there something wrong with the code or the ftp server? <?php $log_file= "ftp://username:password@68.232.164.100/czero/68.232.164.100:27015/czero/gsconsole.log"; $log_handle = fopen($log_file, "r"); $log_contents = fread($log_handle, filesize($log_file)); fclose($log_handle); ?> Console Log: <textarea name="log_view" cols="110" rows="20" readonly="readonly" wrap="virtual"><?php echo "$log_contents" ; ?></textarea> Hey all, my doubt is the following: Is there a way of opening files (images,pdf's,etc) in a popup window? What I intend to do, is have a button, that when pressed, would acess and open certain files in a popup window. I already know how to acess and download the files, but I would like to know how to open them inside the browser. sorry for the bad English. Hope you understood and can help. Thanks alot, Ruben I'm having trouble connecting through fopen using variables as the login details, but with file_get_content it works fine?! These are my variables:- $ftpaddy="ftp.mydomain.com"; $username="me"; $password="password"; $editingdir="/public_html/edit/"; $editfile="editme.txt"; $myftppath = "ftp://" . $username . ":" . $password . "@" . $ftpaddy . $editingdir . $editfile; //puts all variables into string When I try to connect and read the file using the following method it works fine:- $file = file_get_contents("$myftppath", "r"); but when i try and use the same string with fopen as below it doesn't work?! the line i have commented out however works and when i echo the $myftppath variable below it looks the same.. i don't really get it! //$myftppath = "ftp://me:password@ftp.mydomain.com/public_html/edit/editme.txt"; $myftppath = "ftp://" . $username . ":" . $password . "@" . $ftpaddy . $editingdir . $editfile; //puts all variables into string $stream_options = array('ftp' => array('overwrite' => true)); $stream_context = stream_context_create($stream_options); if ($fh = fopen($myftppath, 'w', 0, $stream_context)){//fopen only likes the commented out $myftppath not the one using the variables?! fputs($fh, $newcontents); fclose($fh); } else { die('Could not open file.'); } does anyone know if I am doing the syntax wrong and how to correct it? I read I may need to put another slash after domain.com but this didn't help either. any help would be much appreciated! thanks in advance Kev. Greetings all, I'm completely stumped...so I'd like to run this issue by you guys (and gals!). I have encountered an odd issue, and I have no idea why this is doing what it's doing. When I execute the following code, all by itself, in an "index.php" file (with no other files around...completely isolated!) I get a result of "testtest" $log_file = 'all.txt'; $handle = fopen($log_file, 'a'); fwrite($handle, 'test'); fclose($handle); Note: I delete the file each time I execute the script (in a browser). I am also the only one running this script. I've tried running on PHP 5.2.x and PHP 5.3.x I have also tried on my machine as well as a separate, remote machine. Is the script running twice? If so, what's causing it? Any help is appreciated as always! Ryan Ive just tried to use fopen for the first time, but ive been denied access. Im trying to create a new page. Code: [Select] $query = mysql_query("SELECT DISTINCT subtype FROM business WHERE type ='Restaurant' ORDER BY name"); echo mysql_error(); while($ntx=mysql_fetch_row($query)) $nt[] = $ntx[0]; $i = -1; foreach($nt as $value){ $i++; echo "<a href='" . str_replace(' ','_',$nt[$i]) . ".html'>" . $nt[$i] . "</a>" . "<br/>";} $FileName = str_replace(' ','_',$nt[$i]) . ".html"; $FileHandle = fopen($FileName, 'w') or die("cant open file"); fclose($FileHandle); Warning: fopen(Indian.html) [function.fopen]: failed to open stream: Permission denied in D:\Hosting\######\html\1pw\b.php on line 40 cant open file. The hosting company I use say in their help forum; "If a file is outside of the paths defined by open_basedir, PHP will refuse to open it" Is there a query I can run to find out which paths are defined by open_basedir and is it possible to edit open_basedir? Hi, I am modding phpBB3 and I want to make the contents of a text documents appear in a border. This is what I have in my portal_style.html: Code: [Select] <!-- INCLUDE overall_header.html --> <?php $a1=fopen("/port/announce/announce1.txt", "r"); $a2=fopen("/port/announce/announce2.txt", "r"); $a3=fopen("/port/announce/announce3.txt", "r"); $a4=fopen("/port/announce/announce4.txt", "r"); $a5=fopen("/port/announce/announce5.txt", "r"); ?> <h2>Announcement!</h2> <div class="panel"> <div class="inner"><span class="corners-top"><span></span></span> <div class="content"> <?php echo $a1; ?> </div> <span class="corners-bottom"><span></span></span></div></div> <h2>Announcement!</h2> <div class="panel"> <div class="inner"><span class="corners-top"><span></span></span> <div class="content"> <?php echo $a2; ?> </div> <span class="corners-bottom"><span></span></span></div> </div> <!-- INCLUDE jumpbox.html --> <!-- INCLUDE overall_footer.html --> Anyone mind showing me how to make it work? Thanks. I have a script that uses fopen, except the site doesn't allow it. does any one know how i can rewrite this using curl? f(isset($_REQUEST['l']) && $_REQUEST['l'] <> ''){ $link = VAR.'/blah/blaf/blah/'.rawurlencode($_REQUEST['l']).'/blah/1'; $fp = fopen($link,'r'); foreach($http_response_header as $v){if(substr($v,0,7)=='Content'){header($v);}} fpassthru($fp); fclose($fp); }else{echo 'Parameters not set';} Im kindof a noob. |