RE: [PHP] Re: Embedding JavaScript into a PHP generated web page

2004-07-25 Thread Ash Young
I'd suggest putting some new line characters in after the  '; ?> ...

 echo ' ';


As soon as I hit the button 'Window' I get an ''object expected" error.

Any thoughts?
Rob

"Robert Frame" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> After I posted this I did some more searching on google and found the 
> following code, which works.
>
> echo 'function myWindow(){ 
> alert("javascript from php");}';
>
> I then tried it without the  tag and it still worked.  Apparently 
> I
had
> something out of wack, probably a quote.
>
> Off hand though, can anyone tell me what  is?
>
> Thanks for the help.
> Rob
>
> "Robert Frame" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
> > Hi There,
> >
> > I have a web page with a form that is generated by PHP, and part of 
> > my design utilizes JavaScript to provide some error checking within 
> > the
> objects
> > in the form.  I have written the javascript in an html document, but 
> > I
am
> > having trouble blending the two together.
> >
> > I have tried sending the javascript within an echo statement, as 
> > well as using straight HTML/JavaScript code, but nothing seems to work.
> >
> > Can anyone offer some help or direct me to a solution?
> >
> > Thanks,
> > Rob

--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Question about for

2004-07-25 Thread Ash Young
You could try

for ($i=1;$i<11;$i=$i+2)

-- 
ash young :: http://evoluted.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Embedding JavaScript into a PHP generated web page

2004-07-25 Thread Ash Young
Are you getting any error message at all or is the JavaScript just failing?

If your receiving a PHP error, are you sure you've escaped all the quotes in
the JavaScript?

-- 
ash young :: http://evoluted.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] A Problem With Loops

2002-01-10 Thread Ash Young

Hi,

Sorry about not showing the code, there is a lot of it. Now this script
works in my pc, running IIS5 but not on my web host.

If you remove various parts of the main if statments then it manages more
than 20. Depending which if statement is removed, changes how many
iterations it will last for. However it will iterate the the correct amount
if it never chooses a if statement. That make sense?

The posted below, sorry there is quite a lot of it in the for loop :)

Cheers,

Ash Young





for($n=3;$n") -
$pos[MESSAGE]-1);
// See if it exists already in our nicklist array
if (!isset($nicklist)) {
  $nicklist[$currentnick] = new NickName($currentnick,$n,0,0);
}
elseif (@array_key_exists($currentnick, $nicklist)) {
  $nicklist[$currentnick]->addLine($n);
}
else {
  $nicklist[$currentnick] = new NickName($currentnick,$n,0,0);
}
/*

*
* NOW CREATE TIME OF DAY ARRAY

*
*/
$currenthr = substr($fcontents[$n],1,2);
if(is_numeric($currenthr))
  $timeofday[$currenthr]++;
  }
  elseif($mode==MODECHANGE) {
/*

*
* CHANGE MODE CODE
*
* FIRST SEE IF TOPIC LINE

*
*/
$lstart = $pos[MODECHANGE]+4;
if (substr($fcontents[$n],$lstart,5)=="Topic") {
/*

*
* DEAL WITH TOPIC ON JOIN, ADD TO TOPIC ARRAY, THEN WITH TOPIC CHANGE

*
*/
  $prevtopics[] =
substr($fcontents[$n],$lstart+10,strlen($fcontents[$n])-$lstart-13);
}
elseif(strpos($fcontents[$n],"changes topic") <> NULL) {
  $temppos = strpos($fcontents[$n],"changes topic")+18;
  $prevtopics[] =
substr($fcontents[$n],$temppos,strlen($fcontents[$n])-$temppos-2);
}
  }
  elseif($mode==ACTION) {
/*

*
* ACTION CODE
* GET NICKNAME, THEN CHECK TO SEE IF EXISTS IN NICK ARRAY IF NOT ADD,
CREATING
* A NEW NICKNAME OBJECT WITH IT.
* ELSE INCREMENT ADD THE LINENO TO THE OBJECT FOR RANDOM LINE PROCESSING

*
*/
$currentnick =
substr($fcontents[$n],$pos[ACTION]+2,strpos(substr_replace($fcontents[$n],""
,0,$pos[ACTION]+2)," "));
// See if it exists already in our nicklist array
if (!isset($nicklist)) {
  $nicklist[$currentnick] = new NickName($currentnick,0,0,$n);
}
elseif (@array_key_exists($currentnick, $nicklist)) {
  $nicklist[$currentnick]->addAction($n);
}
else {
  $nicklist[$currentnick] = new NickName($currentnick,0,0,$n);
}
  }
  elseif($mode==NOTICE) {
/*

*
* NOTICE CODE
* CHECK IF NOTICE IS ACTUALLY WHOIS. IF SO SKIP THE WHOIS AND CONTINUE
PROCESSING

*
*/
if(strlen($fcontents[$n])==3) {
  $i=$n+1; while(strlen($fcontents[$n])!=3 && $i<=$linecount) $i++;
$n=$i;
}
  }
  elseif($mode==SESSION) {
/*

*
* SESSION CODE
* SET THE DATE OF THE SESSION END

*
*/
$logenddate =
strtotime(substr_replace(substr($fcontents[$n],19,20),"",7,9));
  }
}




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] A Problem With Loops

2002-01-10 Thread Ash Young

Hi,

I am having a problem with any type of loop, for, foreach, while. I have a
PHP script that loops through an array that contains the contents of a text
file and processes the data it recieves.

My problem is that the loop will only manage about 18 iterations before
processing dies. I know that PHP scripts on my web host have a max 60sec
execution time but it is not getting anywhere near that time.

Any one have any ideas what I'm doing wrong?



Cheers,

Ash Young


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]