Jump to content

Recommended Posts

ok so i get

 

 

 

Warning: Cannot use a scalar value as an array in /home/willowg/public_html/global.inc.php on line 74

 

Warning: Cannot use a scalar value as an array in /home/willowg/public_html/header.inc.php on line 114

 

 

those lines are:

 

 

<?php


function makepassword($string ="")

{

$letters = array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z");

if ($string)

{

	$num = rand(10,99);

	$string .= $num;

	$x = 0;

	while ($x < 2)

	{

		$which_letter = rand(0,25);

		$string .= $letters[$which_letter];

		$x++;

	}

}

if (!$string)

{

	$x = 0;

	while ($x < 6)

	{

		$which_letter = rand(0,25);

		$string .= $letters[$which_letter];

		$x++;

	}

	$num = rand(1000,9999);

	$string .= $num;

}

return $string;//line 74    

function admin_smilies($string) //line 114

{

include "config.inc.php";

$smilies = file("$websiteURL/lists/smilies.txt");

$num_smilies = count($smilies);

$x = 0;

while ($x < $num_smilies)

{

	$array = explode(" ",$smilies[$x]);

	$array[3] = ereg_replace("\r","",$array[3]);

	$array[3] = ereg_replace("\n","",$array[3]);

	$string = eregi_replace($array[0],"<img src=../images/smilies/$array[1] height=$array[2] width=$array[3]>",$string);

	$x++;

}

return $string;

}

?>

 

 

anyone got any ideas how i would fix this ???

Link to comment
https://forums.phpfreaks.com/topic/106854-solved-php-errors/
Share on other sites

umm, well I can't really be more specific than that without pouring over your entire code (which I'm not about to do sorry lol)

 

I mean, I'm not necessarily seeing a problem with the code that you provided, so you're probably gonna have to backtrack and see what argument you're trying to pass to your functions.

 

You just have to go through your code and make sure you didn't do anything like declare your variable somewhere else that's under the same jurisdiction as in this function (like a global variable) etc...

 

p.s.-

 

using $string in more than one function doesn't necessarily mean anything. They are both local variables that are trashed when the function breaks...but it might mean something if you have, as mentioned, a global version of it somewhere.

Link to comment
https://forums.phpfreaks.com/topic/106854-solved-php-errors/#findComment-547792
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.