[PHP] PHP mail() problem

2007-03-20 Thread Delta Storm

Hi,

I'm having problem with character encoding in PHP mail functions.

CODE:
$headers.= Content-Type: text/html; charset=iso-8859-1;
$headers .= MIME-Version: 1.0 ;
$headers .= Content-Transfer-Encoding: 8bit.$eol.$eol;
		$headers .=Content-Type: multipart/alternative; 
boundary=0-92766976-1174383938=:29106;

$to = [EMAIL PROTECTED];
$subject = $_POST['cat'];
$body = $_POST['text'];
if (mail($to, $subject, $body, $headers))
{
			echo('pMessage successfully sent!/pbr /a 
href=showarticle.php?cid=5id=3Povratak/a');

}
else
{
			echo('pMessage delivery failed.../pbr /a 
href=showarticle.php?cid=5id=3Povratak/a');

}

Im receiving mail as you see using yahoo.com. It all works except it 
doesn't show croatian letters... I also tried with encoding utf-8, same 
thing...

ČĆŽŠĐ

Please help, thank you very much!

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



[PHP] Joke of the day problem

2007-03-08 Thread Delta Storm

Hi,

again me with the silly questions...

I need a script that will take data from MySQL database and display one 
row each day.


I have googled, but with no luck.

The database retrieving mechanism is of course clear but I really dont 
know how to do a 24h delay before the next row is displayed.



Thanks in advance :)

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



[PHP] Textarea update problem

2007-03-07 Thread Delta Storm

Hi,

I'd like to thank everybody who have helped me till now. All your 
advices were very helpfull... :)


But I have a problem again

I need to build a script which will have have the following functions:

1.Be able to select 3 columns from a MySQL database(idnetify the columns 
by ID) and put the column contents into 3 textarea objects. (for example 
title,Text1,Text2 each into i textarea).


2.Edit and MySQL update the textarea contents


And all in one script.

The script has a $id = $_GET['id'] variable which holds the information 
about the certain table id.


Thank you very much!

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



Re: [PHP] Textarea update problem

2007-03-07 Thread Delta Storm

[EMAIL PROTECTED] wrote:

is there a question here, or are you asking us to write the script for
you? 


  - Rick


 Original Message 
  

Date: Wednesday, March 07, 2007 01:54:04 PM +0100
From: Delta Storm [EMAIL PROTECTED]
To: php-general@lists.php.net
Subject: [PHP] Textarea update problem

Hi,

I'd like to thank everybody who have helped me till now. All your
advices were very helpfull... :)

But I have a problem again

I need to build a script which will have have the following functions:

1.Be able to select 3 columns from a MySQL database(idnetify the
columns by ID) and put the column contents into 3 textarea objects.
(for example title,Text1,Text2 each into i textarea).

2.Edit and MySQL update the textarea contents


And all in one script.

The script has a $id = $_GET['id'] variable which holds the
information about the certain table id.




-- End Original Message --



  

This is the script, I have dealt with both problems but when I click on
the update button (submit button) i get an error msg:


 Access forbidden!

You don't have permission to access the requested object. It is either
read-protected or not readable by the server.

If you think this is a server error, please contact the webmaster
mailto:[EMAIL PROTECTED].


   Error 403

localhost /
03/07/07 16:17:37
Apache/2.2.3 (Win32) DAV/2 mod_ssl/2.2.3 OpenSSL/0.9.8d
mod_autoindex_color PHP/5.2.0


The user name and pass for the MySQL server are 100% correct.

It reads out the data from the database into the textarea object but
when I click the update button I get that msg.

Thank you! :)



!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml; lang=hr
head
meta http-equiv=Content-Type content=text/html; charset=utf-8
meta http-equiv=Content-Language content=hr
titleUPDATE news and article items/title
link rel=stylesheet type=text/css href=style.css /
/head
body


?php

   $id = $_GET['id'];
   include(authenticate.php);
   $link = mysql_connect(localhost,$admin,$pass) or die (Could
not connect to database);

   mysql_select_db(europe) or die (Could not select database);

   mysql_query(set names utf8);
   $selResult = mysql_query(select title,sText,fText from news where
id='$id');

   if (mysql_num_rows($selResult)  0)
   {
   while ($row = mysql_fetch_array($selResult))
   {
   if (!$_POST[submit])
   {
   echo 'table border=0 cellspacing=0 cellpadding=0
align=center';
   echo tr;
   echo 'td colspan=2';
   echo form action='?php echo
$_SERVER[PHP_SELF] ?' method=post;
   echo input type=text size=180 name=title
value= . $row['title'] .;
   echo /td;
   echo /tr;
   echo tr;
   echo td;
   echo h2sText/h2;
   echo 'textarea cols=65 rows=30 name=sText';
   echo $row['sText'];
   echo /textarea;
   echo '/td
   td
   h2fText/h2
   textarea cols=65 rows=30 name=fText ';
   echo $row['fText'];
   echo '/textarea
   /td
   /tr
   tr
   td colspan=2 align=center
   input type=submit value=UPDATE name=submit
   /form
   /td
   /tr
   /table';
   }
   else
   {
   $title = ($_POST['title']);
   $sText = ($_POST['sText']);
   $fText = ($_POST['fText']);

   $query = update news set title='$title',
sText='$sText', fText='$fText' where id='$id';

   $result = mysql_query($query) or die (could not process
query : $query . mysql_error());

   if ($result)
   {
   echo Data updated succesfully;
   echo 'a href=edititems.phpPovratak na
editiranje/a';
   }
   else
   {
   echo Data update FAILED;
   }
   mysql_close($link);
   }
   }
   }

?
/body
/html

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



[PHP] Image storing

2007-03-05 Thread Delta Storm

Hi,

Can you recommend the best way to store an image into the MySQL database 
and optimze it.


And display and manipulate that image in PHP.

Thank you very much!

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



[PHP] ID problem

2007-02-28 Thread Delta Storm

Hi,

I'm building an CMS system (for practice and experience :)).

And of course like many times before I have encountered a problem.

The problem is:

I have a index.php that takes the news from the database and publishes 
them. And by the end of every news on index.php I have a link ('a 
href=showfullnews.php?id=$idShow full news/a')


That leads to a page that has the full news.

At the beginning of showfullnews i have a variable ( $id = $_GET['id']; )

And in index.php I have the following code:

while ($row = mysql_fetch_array($result))
{
$id= $row['id'];
etc...
}

In the database I have two tables one for a short version of news for 
index.php and another for fullNews.


In full news the query is: select title,newsFull from fullnews where 
id='$id';


In the database i'm 100% sure there is a id = 1 in both rows.

I really dont know what is the problem.

Thank you very much!

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



[PHP] Latin letter problem!

2007-02-20 Thread Delta Storm

Hi,

I'm building an simple CMS system. I have built almost everything but 
one thing buggs me...


I have a MySQL database built for publishing news 
(Id,title,newsContent,timestamp).


And I have a php web page that displays that content. The problem is 
with the charset, in the database the settings are following:


character set latin2 collation latin2_croatian_ci;

and in the tables character set utf8;

I display the data in the php page using utf8 I see all the non-PHP 
content pure HTML content capable of seeing croatian letter čćžšđ, but 
in the news section I only see čćđ. But they are on the same page!


I tried putting other HTML charsets like iso-8859-1,iso-8859-2 etc...
But in all the scenarios I get the HTMl part working but PHP not working 
vice-versa...



Please help me it is a very important web page if you need any other 
information just ask!


Thank you very much in advance!

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



[PHP] Beginner Question

2007-01-19 Thread Delta Storm

Hi,

I have learned as lot about PHP but I still dont know how do they build 
PHP based web sites.


I need to build a complete PHP site with a lot of content and integrate 
CSS,javaScript and a lot of other stuff (for the school)


(Complete site for example. www.domain1.com/index.php or 
www.domain2.co/about?set=p1)
I want to know how are the sites built, do they build for each page a 
PHP script or do they build just a couple of scripts and a database full 
of content and just retrieve and delete,edit,show database information?


I know that when I see in the sites url php? that means that site has a 
database, right...?


Either way I would be very gratefull if you could you give me a detailed 
explanation of the process of building a PHP/MySQL site (I know to write 
scripts in PHP so im not a total beginner).



Thank you very much in advance!!

P.S Please, I understand this could be a stupid question but please bare 
with me...  :)


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



[PHP] Problems with mysql_connect()

2007-01-10 Thread Delta Storm

Hi,

I'm having problems with this code (a simple exercise where i wanto to 
connect to sql server and get data from it and write that data in html)



:



!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;

html xmlns=http://www.w3.org/1999/xhtml;
head
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /
titleExercise 23 - Using PHP with MySQL/title
/head

body
?php

//Povezuje se s MySQL serverom
	$connection = mysql_connect('localhost','user','pass') or die  	 
(Unable to connect to MySQL server);


//Odabira bazu podataka
mysql_select_db(php1) or die (Unable to select database);

//Pravi i zadaje upit
$query = SELECT * FROM items;
	$result = mysql_query($query) or die (Error in query: $query . 	. 
mysql_error());


//Provjerava jeli li zapisi vraceni
if (mysql_num_rows($result)  0)
{
//Pravi html tablicu
echo table width=100% cellpadding=10 cellspacing=0
border=1;
echo tr
td
bID/b
/td
td
bName/b
/td
td
bPrice/b
/td
/tr;

//Prolazi kroz skup zapisa
//ispisuje svako polje
while ($row = mysql_fetch_row($result)
{
echo tr;
echo td . $row [0] ./td;
echo td . $row [1] ./td;
echo td . $row [2] ./td;
echo /tr;
}
echo /table;

}
else
{
//Ispisuje poruku o gresci
echo No rows found!;
}

//Kad je obrada gotova oslobada skup rezultata
mysql_free_result($result);

//Prekida vezu s MySQL serverom
mysql_close($connection);
?

/body
/html


the error is : Parse error: parse error, unexpected '{' in C:\Program 
Files\XAMPP\xampp\htdocs\test_folder\exercise23.php on line 41


I really dont know why is this error showing i looked for syntax errors 
but i think that there aren't any



Thanks in advance! :)


(P.S dont read the commnents they are croatian)

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



[PHP] File reading code2

2007-01-06 Thread Delta Storm

Hi,

Can someone make me an example of simple reading a *.txt file on a hard 
drive

and displaying that file with a echo command or some loop or anything
path to file:

(C:\Program Files\XAMPP\xampp\htdocs\test_folder\test1.txt) btw the 
script is in this folder to.


Full code please.


Thanks in advance!

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



[PHP] Problem with file reading

2007-01-05 Thread Delta Storm

Hi,

I'm a beginner and i'm still learning PHP and I got a problem:




	$file = http://localhost/test_folder/test1.txt;; //I have also 	 
tried test_folder/test1.txt and text1.txt



$fh = fopen($file, r) or die(Could not open file!);


$data = fread($fh, filesize($file)) or die (Could not read  
  file!);


fclose($fh);


echo $data;


The file exist, I'm using apache server on my PC for practicing and the 
file is located in the servers root folder on the subfolder test_folder.


Help would be greatly appreaciated

Thanks in advance!

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



[PHP] Still problem with file reading

2007-01-05 Thread Delta Storm

Hi,

I wrote a while back saying of my problem...

I tried to read a file I tried in a couple of ways and i posted a 
question on this newsgroup and a couple of people helped me (btw, thank 
you for help) and they suggested a few other ways I tried all possible 
ways and i could read a file it says:


Failed to open stream! No such file or directory exists

while im 100% sure the file exists

path of the file: C:\Program Files\XAMPP\xampp\htdocs\test_folder\test1.txt

htdocs is apache's root directory I tried setting the file there
C:\Program Files\XAMPP\xampp\htdocs

but still the same I have tried the URL approach the above aproach the 
plain test1.txt aproach as to relative to the DOCUMENT_ROOT i have 
tried everything but still it doesn't work


I tried to use echo is_readable and file_exists and it returned 
negative, that the file does not exists but i say again the file does 
exist I didn't spelled it wrong I have checked a hundred times but 
always the same answer!


PLEASE HELP, I'm learning PHP by a book and I have a whole section about 
file reading,writing... And I dont want to skip any part of the book! :)


If you need more info, I'll be happy to answer any question.

THANK YOU in advance!

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



[PHP] Array decleration problem

2007-01-03 Thread Delta Storm

Hi,

I'm new to php and im learning, I haven't encounter any problems till 
now so please help me? :)


the code: (learning arrays...)

?php

$flavors=array (banana, cucumber, grape, vanilla)


$flavors2 [0] =3;
$flavors2 [1]=13;

$fruits [red] = system;
$fruits [yellow] = server;
$fruits [purple] = client;

echo $flavors;
echo br /;
echo $flavors2;
echo br /;
echo $fruits;

?

I get an error message:
Parse error: parse error, unexpected T_VARIABLE in C:\Program 
Files\XAMPP\xampp\htdocs\test_folder\exercise12.php on line 16


I embedded the code into an html document so line 16 is line 6 
($flavors2[0]=3;)


I have no idea why is this error showing up i tried everything

Thank you in advance

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