php-general Digest 9 Jan 2005 10:48:38 -0000 Issue 3217

Topics (messages 205888 through 205896):

How do I start at a specific position in an array? Is there a function?
        205888 by: Brent Clements

sending multiple headers (session_start() and setcookie() )
        205889 by: Ben
        205890 by: Hans Zaunere

where can i find some tutorials aout sockets ?
        205891 by: Serban Nicolae

Problem with WHILE using MYSQL database
        205892 by: Labunski

how to read the path of the current document's url
        205893 by: Tim Burgan

>From Poland
        205894 by: Ewa Rubach Wardawy

[PHP 4.3.7] $_POST accented characters
        205895 by: pf.sistemasdinamicos.com.ar

imagecreatefromjpeg
        205896 by: Juergen Rehberger

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 ---
I know this is a simple question because I could easily write a loop
to move to the specific position in the array, but I want to know is
there a function to move the array pointer position to a specific
position in the array?

Thanks,
Brent

--- End Message ---
--- Begin Message ---
Hi all,

In my .php file, I'm using both session_start() and setcookie() before
<html> tag. It gives me following warning message:

Warning: Cannot modify header information - headers already sent by
(output started at D:\Apache Group\Apache2\htdocs\YC\songs.php:4) in
D:\Apache Group\Apache2\htdocs\YC\ycphpfunc.php on line 148

My .php file looks like this: 

<?php session_start(); ?>

<?php 
        ob_start();
        include 'ycphpfunc.php';
        $login = new login_class;
        if ($_POST[logusername] == "" || $_POST[logpassword] == "") {}
        else {
                $login->check_login($_POST['logusername'], 
$_POST['logpassword'],
$_POST['remember']);
        }
        ob_end_flush();
?>
<html>
.......
.......
</html>

The call to check_login()calls setcookie() function through another
function inside my "ycphpfunc.php" file.

Can someone show me a way to include both session_start() and
setcookie() before <html>?

Thanks for your time!
Ben

--- End Message ---
--- Begin Message ---
> In my .php file, I'm using both session_start() and setcookie() before
> <html> tag. It gives me following warning message:
>=20
> Warning: Cannot modify header information - headers already sent by
> (output started at D:\Apache Group\Apache2\htdocs\YC\songs.php:4) in
> D:\Apache Group\Apache2\htdocs\YC\ycphpfunc.php on line 148
>=20
> My .php file looks like this:
>=20
> <?php session_start(); ?>
>=20
> <?php

Your output is started right there, above this <?php tag.  There's no =
reason to break out of, and then back into, PHP processing.  Just make =
it like this:

<?php

session_start();

ob_start();

...

?>
<html>
...
</html>


Also, be sure there is no whitespace at the end of the ycphpfunc.php =
file, or leave off the closing PHP tag completely.

---
Hans Zaunere
President, Founder
New York PHP
http://www.nyphp.org

--- End Message ---
--- Begin Message ---
where can i find some tutorials aout sockets ?

--- End Message ---
--- Begin Message ---
Hi,
this script output's data from the database..

$data = mysql_query("SELECT * FROM firt_table WHERE cat='sweaters' ORDER BY
`id` ASC ") or die("can't find DB!");
while($line = mysql_fetch_array($data)){
echo' <tr><td width="225" height="19"'.$line['product'].'</td></tr>';
}

for example, there are 3 records in the "first_table", so script will output
only 3 records:
<tr><td width="225" height="19"'.$line['product'].'</td></tr>
<tr><td width="225" height="19"'.$line['product'].'</td></tr>
<tr><td width="225" height="19"'.$line['product'].'</td></tr>

It's ok. But I need to output 10 records always, even if there are less than
10 records in the database.

Can someone help me, please?
Lab

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

I have a page where the URL is along the lines of http://www.example.com/test.php

I've tried using the parse_url() function without success.. I'm trying to just get "test.php" returned as a string.

Can someone please point me in the right direction with this.

Thank you for your time.

Tim
--- End Message ---
--- Begin Message ---
Dear Greg! 

This is Jarek.Wardawy. It's not a joke I promisse! This is my real name.
Some time ago I found your name in internet I wrote an e-mail to you. No
answer. Maybe this time.

I' m from Poland, living in a city Ostrow Wielkopolski. I'm working as a
journalist, and that's the reason why I spend so much time in internet. 

I'm oopen minded person, 40 years old. I'll be happy o write you more about
me and my family. At least, we have the family name. I'm interested of your
background, probably it comes from Poland. Is interesting for you? If so,
write me back, also for [EMAIL PROTECTED]  Just put the name wardawy in
google, and you'll see, that it's not a stupid joke. 

 

Best regards

Jarek Wardawy 

>From Poland 

 


--- End Message ---
--- Begin Message ---
Hello, I've spent all night trying to make a simple form checking
function that checks the name text field from a form.

For example: if I put Beltr�n in the form, the
 ord($_POST['name_field'][5])=195 and not the spanish �=ord()225

Everything is ok if I use a variable in a test script:
$var="Beltr�n";
if(preg_match("/�/", $var))
.
.
it works ok, but not if the $var variable is take from a $_POST...
so I guess something is going on with the $_POST

another thing:
strlen($_POST['name_field'])
everything goes ok if the $_POST value has no accented characters, but
if it has, the strlen() results in 1 more, for ex "Beltr�n" will
result an strlen() of 8, not 7 (maybe this is because it uses 2
characters to encode de accented letter).

I used setlocale(LC_ALL, "es_ES") and LC_MESSAGES with same results.
I changed html page encoding from charset=iso-8859-1 to charset=utf-8,
the same.

I'm testing this in a Fedora C2 with php 4.3.7

any ideas, please?

Thanks a lot in advance.

H M

--- End Message ---
--- Begin Message ---
i have a problem with my resizing image script.

It all works fine on my localhost server, but once i upload the whole thing on 
my webhost, the script allows resizing of images not bigger than 600kb or 
something aournd that size. so my question. does that problem depend on 
settings from my webhost. i uploaded (without resizing) images with a filesize 
of 1.2mb and it was working. but once i try to add the resizing function i get 
following error message

Fatal error: Allowed memory size of 8388608 bytes exhausted at (null):0 (tried 
to allocate 1632 bytes) in /var/www/html/familie/cms/addimage.php on line 39


can you help me out with this... thanx
J

--- End Message ---

Reply via email to