Jump to content

Desperate Need Of Help Regarding Problem with PHP Guestbook ($25 Reward for Help


siahdesign

Recommended Posts

Hey guys,  :o

 

I'm in a bind - I've spent forever trying to fix this and I don't know what to do.

 

I'm trying to fix a guestbook at this address:

 

http://www.josties.com/output.php

 

And as you can see I am getting a:

 

"Warning: file() expects parameter 2 to be long, string given in /home/siahdesi/public_html/josties/output.php on line 39"

 

I started getting this message after I switched the website to a new server.

 

I've spent too much time trying to figure it out.

 

I am allowing the source files to be downloaded from here:

 

http://www.4shared.com/dir/10016603/c9534b6b/sharing.html

 

(you may have to sign up for an account there - not sure) I took out the guestbook's admin password before uploading so there is nothing private in the files.)

 

If someone is able to find the problem and fix it for me I will send them a $25.00 USD PayPal payment. Any suggestions would be appreciated also.

 

Desperate,  ???

 

Thanks!

 

J

 

Hi

 

I would say that your issue is in this line (line 40 in the output.php file)

 

$user_data=file("data.txt", "r");

 

Try using the file() function without the "r". So  $user_data=file("data.txt");

 

See how you go with that.

Hey Alt_F4! Thanks for your response! That did take away the error - THANK YOU! But now I'm having issues with the content overflowing the assigned space for the guestbook. Its really weird.

 

You can see it here now:

 

http://www.josties.com/output.php

 

BTW, could you send me your email address to: jjjost at gmail.com

 

I would be happy to send you the PayPal payment now.

try changing the variable user_data[1] to a set value (like 60) everywhere it occur in the following code

 

if(strlen($text)>$user_data[1])
            {
               $cut_text=wordwrap($text,$user_data[1],"%@%");
            if ($cut_text!="")
            {
               $pos=strpos($cut_text,"%@%");
               $new_cut_text=substr($cut_text,0,$pos);
               echo $new_cut_text."(...)<br><form  method=\"post\" action=\"ShowAll.php\">
            <input type=\"hidden\" name=\"Date\"  value=\"".$cell[0]."\">
            <input type=\"hidden\" name=\"User\"  value=\"".$user[0]."\">
            <input type=\"hidden\" name=\"Text\"  value=\"".$text."\">
            ";
            }
            if ($cut_text=="")
            {
            $new_cut_text=substr($text,0 ,$user_data[1]);
            echo $new_cut_text."(...)<br><form  method=\"post\" action=\"ShowAll.php\">
            <input type=\"hidden\" name=\"Date\"  value=\"".$cell[0]."\">
            <input type=\"hidden\" name=\"User\"  value=\"".$user[0]."\">
            <input type=\"hidden\" name=\"Text\"  value=\"".$text."\">
            ";
            }
        ?>
            <b onClick="submit(document.forms[0].elements);">
            <u><font color="#00008b">see the whole comment</font></u></b>
            </form>
            <?
            }
//show short comments
         elseif (strlen($text)<$user_data[1])
            {
            echo $text;
            }

 

and that should limit the text displayed to 60 characters

 

BTW 60 is just an example pick a value that looks good on your site

 

I'll have a quick look at it and let you know.

 

Keep your money, just glad i could help you out  ;D

 

I was able to fix the overflow by modifying some of the internal CSS. Man, thanks SOOO much for your help!! I would be happy to pay you! Or at least give you some kudos some how via Twitter or my website (http://www.siahdesign.com)

 

Thanks again!!  ;D

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.