siahdesign Posted October 23, 2008 Share Posted October 23, 2008 Hey guys, 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 Link to comment https://forums.phpfreaks.com/topic/129864-desperate-need-of-help-regarding-problem-with-php-guestbook-25-reward-for-help/ Share on other sites More sharing options...
kenrbnsn Posted October 23, 2008 Share Posted October 23, 2008 If you want to pay someone to help you, please post in the Freelancing area. If you want help here, please post the relevant code between tags. Ken Link to comment https://forums.phpfreaks.com/topic/129864-desperate-need-of-help-regarding-problem-with-php-guestbook-25-reward-for-help/#findComment-673266 Share on other sites More sharing options...
Alt_F4 Posted October 23, 2008 Share Posted October 23, 2008 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. Link to comment https://forums.phpfreaks.com/topic/129864-desperate-need-of-help-regarding-problem-with-php-guestbook-25-reward-for-help/#findComment-673283 Share on other sites More sharing options...
siahdesign Posted October 24, 2008 Author Share Posted October 24, 2008 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. Link to comment https://forums.phpfreaks.com/topic/129864-desperate-need-of-help-regarding-problem-with-php-guestbook-25-reward-for-help/#findComment-673296 Share on other sites More sharing options...
Alt_F4 Posted October 24, 2008 Share Posted October 24, 2008 I'll have a quick look at it and let you know. Keep your money, just glad i could help you out Link to comment https://forums.phpfreaks.com/topic/129864-desperate-need-of-help-regarding-problem-with-php-guestbook-25-reward-for-help/#findComment-673311 Share on other sites More sharing options...
Alt_F4 Posted October 24, 2008 Share Posted October 24, 2008 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 Link to comment https://forums.phpfreaks.com/topic/129864-desperate-need-of-help-regarding-problem-with-php-guestbook-25-reward-for-help/#findComment-673318 Share on other sites More sharing options...
siahdesign Posted October 24, 2008 Author Share Posted October 24, 2008 I'll have a quick look at it and let you know. Keep your money, just glad i could help you out 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!! Link to comment https://forums.phpfreaks.com/topic/129864-desperate-need-of-help-regarding-problem-with-php-guestbook-25-reward-for-help/#findComment-673449 Share on other sites More sharing options...
Alt_F4 Posted October 24, 2008 Share Posted October 24, 2008 No worries, glad you got it sorted. No need for the kudos, believe me i've had plenty of help from this forum so its good that i can give something back Cheers Link to comment https://forums.phpfreaks.com/topic/129864-desperate-need-of-help-regarding-problem-with-php-guestbook-25-reward-for-help/#findComment-673453 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.