Free Web Hosting Forum
(#1 (permalink))
Old
Member
Lovsan is on a distinguished road
 
Posts: 38
Join Date: Oct 2008
Default hmm? - 11-09-2008, 02:50 AM

PHP Error Message

Warning: fopen(69242427549164d1f9c006.sk) [function.fopen]: failed to open stream: Permission denied in /home/a6x1/public_html/paste/index.php on line 62

Free Web Hosting

PHP Error Message

Warning: fwrite(): supplied argument is not a valid stream resource in /home/a6x/public_html/paste/index.php on line 64

Free Web Hosting

PHP Error Message

Warning: fclose(): supplied argument is not a valid stream resource in /home/axxxxxxx1/public_html/paste/index.php on line 65

Free Web Hosting
Paste saved with id = 69242427549164d1f9c006
PHP Error Message

Warning: Invalid argument supplied for foreach() in /home/axxxxx/public_html/paste/index.php on line 69

---------------------------------------

whats wrong here? works fine on my pc wamp server installed
Reply With Quote
(#2 (permalink))
Old
Junior Member
rafal is on a distinguished road
 
Posts: 3
Join Date: Nov 2008
Default 11-10-2008, 08:28 AM

It's hard to say without source code...
How do you give the path? Is it relative or absolute?
Reply With Quote
(#3 (permalink))
Old
Member
Lovsan is on a distinguished road
 
Posts: 38
Join Date: Oct 2008
Default source code - 11-11-2008, 02:03 PM

http://fbsk.co.cc/paste/

PHP Code:
 <?php
            
if($_GET['id']){
                
#Jos tunnisteella löytyy
                
if(file_exists($_GET['id'].'.paste')){
                    
#Hae tiedosto
                    
$txt file($_GET['id'].'.paste');
                } else {
                    
#Jos ei löydy
                    
die("Invalid ".$_GET['id']." ID number.");
                }
                
#Tulosta paste
                
echo '<h2>Paste '.$_GET['id'] . ":</h2>\n\t".'<div class="rivinro">'."\n\t\t";
                
#Tulosta rivinumerot
                
for($i=1;$i<=count($txt);$i++){
                    echo 
$i.":<br />";
                }
                echo 
"\n\t</div>\n\t".'<pre>'."\n";
                
#tulosta rivi kerrallaan
                
for($i=0$i<=count($txt);$i++){
                    echo 
$txt[$i];
                }
                echo 
"\n\t</pre>";
                
#Lukijalle linkki, johon uusi voidaan jättää uusi. Ota pois jos häiritsee.
                
echo "\n\t<hr /><a href='index.php'>New Paste</a>";
            }
            elseif(
$_POST['paste']){
                
#Otetaan pois HTML ja kenoviivat
                
$_POST['paste'] = htmlspecialchars($_POST['paste']);
                
$_POST['paste'] = stripslashes($_POST['paste']);
                
#Uniikki id
                
$id uniqid(rand());
                
#Avataan pastebin-filu
                
$xfile fopen($id '.paste'"w");
                
#Kirjoitetaan siihen
                
fwrite($xfile$_POST['paste']);
                
fclose($xfile);
                
#Informoidaan käyttäjää
                
echo '<a href="index.php?id='.$id.'">Paste saved with id = '.$id.'</a>';
                
#Käydään läpi pastebin-tiedostot
                
foreach(glob("*.paste") as $pbfilu){
                    
#Tilan säästöä.
                    #Jos yli 2 viikkoa vanha, niin poista armotta || vuosi vaihtunut-poikkeustapaus
                    
if(date(W,time())-date(W,filemtime($pbfilu)) >= || date(W,time())-date(W,filemtime($pbfilu)) < 0){
                        
unlink($pbfilu);
                    }
                }
            
#Jos ei haeta eikä laiteta uutta, niin lomaketta peliin
            
} else {
                echo 
'<form action="index.php" method="get">'."\n\t\t";
                echo 
'<label>Search ID: </label></td><td><input type="text" name="id" id="id" /><input type="submit" value="Search!" />'."\n\t\t";
                echo 
'</form>';
                echo 
'<br /><br /><form action="index.php" method="post">'."\n\t\t";
                echo 
'<textarea cols="60" rows="30" id="paste" name="paste"></textarea>'."\n\t\t";
                echo 
'<br /><input type="submit" value="Submit" />'."\n\t</form>\n";
            }
            
?>
Reply With Quote
(#4 (permalink))
Old
Member
Lovsan is on a distinguished road
 
Posts: 38
Join Date: Oct 2008
Default 11-11-2008, 02:06 PM

im noob lol, it was chmod problem :P
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.6.9
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0
vBulletin Skin developed by: vBStyles.com