php-windows Digest 3 Sep 2003 01:23:47 -0000 Issue 1897

Topics (messages 21302 through 21307):

stuck with substr now .......
        21302 by: toby z
        21303 by: Chris Kranz

Re: SMTP - AOL problem
        21304 by: Craig Roberts

need help
        21305 by: zicux
        21306 by: Miha Nedok
        21307 by: Sek-Mun Wong

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
hay guyz

im stuck with substr now

im sure i ve actually lost it ....

i have a string being passed to a graph as its title
and the title is being retrieved from mysql db

now whenever i store anything with <br> or /r/n 
its displayed normally on the screen

but this time i have to pass this to a jpeg chart being created by jd
library
which is then displayed on the screen

and the title gets displayed as

Medicine Reports /r/n (report generated for below 60% stocked
medicines)

where its supposed to display

Medicine Reports 
(report generated for below 60% stocked medicines)


i have tried a few functions but none of them seem to be working

i can, however pass two strings as title and sub-title to the graph
function call

and for this i need to splitt the title retrieved from db to two
strings ......



=================================================================


<?php



//$pg='rprt_gf_py_3d_1';
// ma dta 

$max_data = count($gfData);

for ($k = 0; $k < $max_data; $k++)
{
        //$arrData[$k] = $gfData[$k] * $factor ;
        $data[$k] = $gfData[$k]  ;
}




// Create the Pie Graph.
$graph = new PieGraph(850,600,"auto");
$graph->SetShadow();



         /*************************
         trying 2 split title :P:P:P  ! ! ! ! 
        **************************/


$newStr="";
                //Replacing \n with <br>                
                /*$tok = strtok($title,":P");
                while ($tok) {
                        $newStr = $newStr.$tok."<br>";
                    $tok = strtok(":P");
                }
                */
                $tok = split($title,":P");
                //while ($tok) {
                        $newStr = $newStr.$tok."<br>";
                    //$tok = substr(":P");
                //}

                echo ($newStr);


//$newStr = explode("\r\n","$title");
//$newStr = explode(chr(10),"$title");
//$newStr = preg_split("/[ \t]+/", $title);






// Set A title for the plot
$graph->title->Set("$newStr");
$graph->subtitle->Set("sub");
$graph->title->SetFont(FF_VERDANA,FS_BOLD,18); 
$graph->title->SetColor("darkblue");
$graph->legend->Pos(0.1,0.2);

// Create 3D pie plot
$p1 = new PiePlot3d($data);
$p1->SetTheme("sand");
$p1->SetCenter(0.4);
$p1->SetSize(150);

// Adjust projection angle
$p1->SetAngle(45);

// Adjsut angle for first slice
$p1->SetStartAngle(45);

// Display the slice values
$p1->value->SetFont(FF_ARIAL,FS_BOLD,11);
$p1->value->SetColor("navy");

// Add colored edges to the 3D pie
// NOTE: You can't have exploded slices with edges!
$p1->SetEdge("navy");


for ($i = 0; $i < $max_data; $i++)
{
        if ($arrData[$i] > $max_value)
                $max_value = $arrData[$i];

        if ( strlen($label[$i]) > $max_label_width )
                $max_label_width = strlen($label[$i]);

$p1->SetLegends($label);

$ttl_rkrdz = array_sum($gfData);
}


$graph->Add($p1);
$graph->Stroke("abc.jpg");
        
        echo("
                        <table width='100%' border='1'>
                                <tr> <td align='right'>
                                        <img src=abc.jpg>
                                </td> </tr>
                        </table>
                        
                        <br><br><br>
        ");
        


$table_text = "<table align=center border='0'><tr><td
align='center'>&nbsp;</td></tr>
                                
                                <tr><td align=center></td></tr><tr><td align=center 
><br><table
border=4><tr>";



for ($i = 0; $i < $max_data; $i++)
{
        if ($arrData[$i] > $max_value)
                $max_value = $arrData[$i];

        if ( strlen($label[$i]) > $max_label_width )
                $max_label_width = strlen($label[$i]);

        $table_text = $table_text . "<th> " . $label[$i] . " </th>";
        $ttl_rkrdz = array_sum($gfData);

}
$table_text = $table_text . "</tr>";
$table_text = $table_text . "<tr>";


for ($i = 0; $i < $max_data; $i++)
{

        $table_text = $table_text . "<td style= \"font-family: $font\" >" .
$gfData[$i] . "</td>";
        
        
}
$table_text = $table_text . "</tr>
                </table></td></tr>
                <tr>
                        <td style= \"font-family: $font\"> </td> 
                </tr>
                                <tr><td>&nbsp;</td></tr>
                                
                <tr> <td>
                <table border='4' align=center> 
                <tr>
                        <th width='50%' valign='center' style= \"font-family: $font\">
Total Records&nbsp; </th>
                        <td width='50%' valign='center' style= \"font-family: $font\">
$ttl_rkrdz </td> 
                </tr>
                </table>
                </td>
                </tr>
                <tr><td>&nbsp;</td></tr>
                <tr><td>&nbsp;</td></tr>
                <tr><td>&nbsp;</td></tr>                                
                ";
                
echo($table_text);

?>


=============================================================


will someone plz jerk me out of this ..... ?????

thnx a million 

toby

________________________________________________________________________
Want to chat instantly with your online friends?  Get the FREE Yahoo!
Messenger http://uk.messenger.yahoo.com/

--- End Message ---
--- Begin Message ---
>
> and for this i need to splitt the title retrieved from db to two
> strings ......
>


$array = explode( "/r/n", $stringToSplit );
print $array[0]; //first part
print $array[1]; //second part

--- End Message ---
--- Begin Message ---
The AOL monkey's right :( - AOL have no SMTP server to connect to....

You can use Yahoo!'s SMTP server, but need to configure the username and
password for a Yahoo! account in php.ini first.

Hope this helps,

Craig Roberts
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> Right then, i've just finished having a heated debate with an AOL
technician
> and he says I am unable to send emails with PHP via the SMTP of my ISP
(which
> is AOL). I dont think the technician fully understands what I am trying to
do,
> but i'm also a little confused over the subject.
>
> If AOL is my ISP then I must use the SMTP referring to AOL, true or false?
If
> so, then how do I go about finding out what it is?
>
> Tryst

--- End Message ---
--- Begin Message ---
Hello,

How can I make my page reload in browser, for example user inputs some
data then some page will say good or bad data and then I want it to
reload to the first page where input form was?


-- 
Thanks,
 .r.

--- End Message ---
--- Begin Message ---
You can use Javascript or look at header().
And check the archives it was discussed before.


-Mike

On Tue, 2 Sep 2003, zicux wrote:

> Date: Tue, 2 Sep 2003 23:36:00 +0300
> From: zicux <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] need help
>
> Hello,
>
> How can I make my page reload in browser, for example user inputs some
> data then some page will say good or bad data and then I want it to
> reload to the first page where input form was?
>
>
> --
> Thanks,
>  .r.
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
1) client pull. use the browser meta-refresh, may not work on some browsers
(like PDA's, etc, nearly all desktop browsers should be ok with this method)
just tricky with passing back QUERY_STRING, if you had stuff from previous
form.
<HTML>
<HEAD>
<META HTTP-EQUIV="refresh"
content="10;URL=http://www.yoursite.com/firstpage.php?action=wrongdata";>
<TITLE>wrong data entered</TITLE>
</HEAD>
<BODY>
you entered the wrong data, please wait you will be redirected.

</BODY>
</HTML>

2) server push: using http headers.

I've not done this, but you can research it if you like. A http server
cannot technically "push" to the browser, but I believe under HTTP1.1 and
using multi-part forms, you can generate server pushes (in fact this is how
a lot of chat stuff works I think) which would do the trick.

3) client pull #2: use javascript

(yuck) even less compatible than yaks and crocodiles... ok I exaggerate for
effect.



"Zicux" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> How can I make my page reload in browser, for example user inputs some
> data then some page will say good or bad data and then I want it to
> reload to the first page where input form was?
>
>
> -- 
> Thanks,
>  .r.

--- End Message ---

Reply via email to