php-general Digest 12 Apr 2006 18:49:35 -0000 Issue 4068
Topics (messages 233827 through 233844):
Re: Instalation Nightmares For Word Press Please Help
233827 by: Chris
233828 by: Jochem Maas
Re: MS SQL extension not loading
233829 by: Laszlo Nagy
Re: help with multidimentional arrays
233830 by: John Wells
233837 by: Bing Du
Dynamic array_merge problem
233831 by: Ace McKool
233832 by: Pure Web Solution
233833 by: Ace McKool
plain text email message format
233834 by: Schalk
233835 by: Jay Blanchard
233836 by: Wolf
233838 by: Angelo Zanetti
Hiding text?
233839 by: William Stokes
233840 by: Jochem Maas
Re: CURLOPT_BINARYTRANSFER
233841 by: Jochem Maas
233844 by: Richard Lynch
ÆóÒµÈçºÎÓ¦¶ÔÅ·ÃÀ¿Í»§²éÑ鹤³§ºÍʵʩSA8000±ê(AD)
233842 by: ËÕÖݾٰì!
Re: regular expressions or something else?
233843 by: Kim Christensen
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:
php-general@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
marvin hunkin wrote:
Hi.
need to install word press version 2.0.
http://wordpress.org/support/
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
marvin hunkin wrote:
Hi.
need to install word press version 2.0.
you need to eat|breath|sleep, but I don't think blogging consitutes a
pre-requisite to the continuation of life on this planet. ;-)
and now using easy php 1-8, and set up my my sql settings in the
wpConfig.php file, and my username is localhost and the password is root.
when i try to load it in the browser, using http://localhost/install.php
which i put in the www. folder of easy php 1-8, i get this error in the
browser:
There doesn't seem to be a wp-config.php file. I need this before we can
Wordpress asks for 'wp-config.php' and you keep mentioning 'wpConfig.php'.
might that be the problem? (note the 2 filenames are not the same) if not
check your placing the wp-config.php in the correct directory.
--- End Message ---
--- Begin Message ---
Hello Richard,
Check the "php.ini" setting in the top portion to see where php.ini
MUST BE for it to be read.
It is telling me:
Configuration File (php.ini) Path C:\WINDOWS
Step #2:
Find your php.ini file, and MOVE it to where phpinfo() wants it to be.
I have my php.ini at C:\WINDOWS\PHP.ini.
Step #3
In php.ini look at the "extensions_dir" setting.
Fix it.
extension_dir = "C:\PHP\ext"
which is correct.
Step #4.
Compare version numbers of your mssql_php.dll and the version of PHP
you are running. You CANNOT mix-n-match old DLLs with new PHP and
vice versa. It will sometimes "work" until you happen to use the one
function that CHANGED between versions.
php_mssql.dll version is 5.1.2.2
PHP version is 5.1.2
Looks okay.
If you just went out and found some random mssql_php.dll to throw in
the directory, it is NOT going to work.
Well, I installed PHP manually, as described in install.txt. The file I
have downloaded was
php-5.1.2-Win32.zip
9,140,593 bytes
It was released on 12 Jan 2006. This is the official latest stable
version, and it had all of the extensions packaged together with
php.exe. I used the same one on my home computer and it worked. I think
this can't be the problem.
Step #4a
Check your log files. I'm assuming ISS actually HAS logfiles... It
must have, right? Might be in system events log. Might be in an
"error_log" file next to your IIS web traffic logs. Knowing
Microsoft, it might be *ANYWHERE*...
Yes, you are right. The event log contains some error entries telling me
this:
Faulting application w3wp.exe, version 6.0.3790.1830, faulting module
unknown, version 0.0.0.0, fault address 0x01b3e8e0. For more
information, see Help and Support center at
http://go.microsoft.com/fwlink/events.asp
The above link contains the text
"We're sorry There is no additional information about this issue in the
Error and Event Log Messages or Knowledge Base databases at this time.
You can use the links in the Support area to determine whether any
additional information might be available elsewhere."
Yes, this is tipical Microsoft. I had to figure out that the logfiles
for my website in under
c:\windows\system32\logfiles\W3SVC848989038\
Don't ask me why. :-) Unfortunately, the logfile does not help, because
it DOES NOT log out php error messages. For example, if I have an error
in my php script, this is all I get:
2006-04-11 16:43:04 127.0.0.1 GET /info.php
=PHPE9568F34-D428-11d2-A769-00AA001ACF42 9000 - 127.0.0.1
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.2;+SV1;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727)
200 0 0
I'm guessing that you might find an error message about the
mssql_php.dll being the wrong version...
Hmm. I also tried to load it with the dl() function, but then I got an
error:
"Warning: dl() [function.dl]: Not supported in multithreaded Web servers
- use extension=php_mssql in your php.ini in
C:\Inetpub\vtracks_server\info.php on line 2"
Step #5.
Switch to a superior web server: Apache
:-)
I wish I could.
Step #6.
Switch to a superior OS like Linux or FreeBSD
:-) :-) :-)
Yes, I would like to. The problem is that I cannot. I got detailed
instructions and my boss wants to run this on IIS6 and Windows. I might
be able to ask him to use apache. That would be wonderful.
It is strange that I have a test server which is almost the same
(Win2003 server, IIS6 and PHP 5.1.2) and it works here. :-/
Thank you for your help.
Laszlo
--- End Message ---
--- Begin Message ---
On 4/11/06, Bing Du <[EMAIL PROTECTED]> wrote:
> ==
> foreach ($sponsor_id as $sponsor => $arr)
> echo "$sponsor:";
> foreach ($arr[$sponsor] as $project) {
> echo "$project<br>";
> }
> ==
>
It looks like you're building your array just fine. Here though, your
second foreach needs to look like this:
[code]
foreach ($arr as $project)
{
echo "$project<br>";
}
[/code]
Your temprorary $arr variable contains only your array of titles, not
an entire row of your 2-dimensional $sonsor_id array. So you do not
need to use the $sponsor key to get at that array.
HTH,
John W
--- End Message ---
--- Begin Message ---
> On 4/11/06, Bing Du <[EMAIL PROTECTED]> wrote:
>> => foreach ($sponsor_id as $sponsor => $arr)
>> echo "$sponsor:";
>> foreach ($arr[$sponsor] as $project) {
>> echo "$project<br>";
>> }
>> =>
>
> It looks like you're building your array just fine. Here though, your
> second foreach needs to look like this:
>
> [code]
> foreach ($arr as $project)
> {
> echo "$project<br>";
> }
> [/code]
>
> Your temprorary $arr variable contains only your array of titles, not
> an entire row of your 2-dimensional $sonsor_id array. So you do not
> need to use the $sponsor key to get at that array.
>
Thanks so much for pointing out that error on $arr, John. You are very
right. Now I realize it's such an obvious error. But I did not notice it
before I posted.
Bing
--- End Message ---
--- Begin Message ---
Hi,
This is the end result I'm trying to get:
$z1 = array_merge($z[0], $z[1], $z[2]);
But what if I don't know how many elements are in $z? I tried this (but it
breaks if there are more than 2 elements in $z):
for ($i=0; $i<count($z); $i++)
{
if ($i<(count($z)-1))
{
$z1 = array_merge($z[$i], $z[$i+1]);
}
}
Any pointers would be greatly appreciated! TIA
--- End Message ---
--- Begin Message ---
Hi
if you just want to sort of concatenate your arrays then why not just loop
through the whole thing in order to get the new single array. Need more info
for further consideration. Hope this helps!
for ($i=0;$i<count($z);$i++){
$z1[$i] = $z[$i];
}
Pure Web Solution
http://www.purewebsolution.co.uk
PHP, MYSQL, Web Design & Web Services
"Ace McKool" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> This is the end result I'm trying to get:
>
> $z1 = array_merge($z[0], $z[1], $z[2]);
>
> But what if I don't know how many elements are in $z? I tried this (but it
> breaks if there are more than 2 elements in $z):
>
> for ($i=0; $i<count($z); $i++)
> {
> if ($i<(count($z)-1))
> {
> $z1 = array_merge($z[$i], $z[$i+1]);
> }
> }
>
> Any pointers would be greatly appreciated! TIA
--- End Message ---
--- Begin Message ---
This worked wonderfully--thank you very much Jochem!
On 4/12/06, Jochem Maas <[EMAIL PROTECTED]> wrote:
>
> Ace McKool wrote:
> > Hi,
> >
> > This is the end result I'm trying to get:
> >
> > $z1 = array_merge($z[0], $z[1], $z[2]);
>
> $yourArrays = array($z[0], $z[1], $z[2]);
> $z1 = call_user_func_array('array_merge', $yourArrays);
>
> obviously - you have to build $yourArray before passing it
> to call_user_func_array()
>
--- End Message ---
--- Begin Message ---
Greetings All,
Is the code below the correct way to 'build' the message for plain text
email?
$message = "Message From: ".$firstName. " " .$lastName."
First Name: ".$firstName."
Last Name: ".$lastName."
Address: ".$address."
Home phone: ".$homePhone."
Best time to contact: ".$bestTime."
Email: ".$email.";
Thanks!
--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers
--- End Message ---
--- Begin Message ---
[snip]
Is the code below the correct way to 'build' the message for plain text
email?
$message = "Message From: ".$firstName. " " .$lastName."
First Name: ".$firstName."
Last Name: ".$lastName."
Address: ".$address."
Home phone: ".$homePhone."
Best time to contact: ".$bestTime."
Email: ".$email.";
[/snip]
Yes. And no.
http://www.php.net/manual/en/function.mail.php
--- End Message ---
--- Begin Message ---
I use
$message ="Message From: $firstname $lastname
First Name: $firstname
Last Name: $lastname
.....
";
Wolf
Schalk wrote:
> Greetings All,
>
> Is the code below the correct way to 'build' the message for plain text
> email?
>
> $message = "Message From: ".$firstName. " " .$lastName."
> First Name: ".$firstName."
> Last Name: ".$lastName."
> Address: ".$address."
> Home phone: ".$homePhone."
> Best time to contact: ".$bestTime."
> Email: ".$email.";
>
> Thanks!
>
--- End Message ---
--- Begin Message ---
Schalk wrote:
Greetings All,
Is the code below the correct way to 'build' the message for plain text
email?
$message = "Message From: ".$firstName. " " .$lastName."
First Name: ".$firstName."
Last Name: ".$lastName."
Address: ".$address."
Home phone: ".$homePhone."
Best time to contact: ".$bestTime."
Email: ".$email.";
Thanks!
just look at the MIME content type of the email that you are sending out:
HTML:
Content-Type: text/html; charset = "iso-8859-1"
Plain Text:
Content-Type: text/plain; charset = "iso-8859-1"
hope this helps.
By the way this gets set in the header.
--- End Message ---
--- Begin Message ---
Hello,
How can I hide error message when user enters to POST action form for first
time? I have a form for collecting and saving user data. In the code below
you can see that there are text messages for user info stored in $teksti
variables. At the end the $teksti is passed to function that displays the
message. Problem is that when user enters the page for firs time the
variables are empty and therefore basically the decisions made with variable
values result to error message at the first time.
Thanks for your advice
-Will
Here's code:
if ($ryhma != 'Valitse:' && $ryhma != ''){
if ($ikaluokka != ''){
$sql="SELECT ikaluokka FROM x_ikaluokat WHERE ryhma = '$ryhma'";
$result=mysql_query($sql);
$num = mysql_num_rows($result);
$cur = 1;
if ($num == '0'){
$check = "ok";
}
while ($num >= $cur) {
$row = mysql_fetch_array($result);
$il = $row["ikaluokka"];
if ($il == $ikaluokka){
$teksti = "Virhe! Samanniminen ikäluokka on jo tässä ryhmässä.";
$check = "bad";
} else {
$check = "ok";
}
$cur++;
}
if ($check == "ok"){
$sql_lauseke = "INSERT INTO x_ikaluokat (ryhma, ikaluokka)
VALUES ('$ryhma','$ikaluokka')";
if (!$kysely = mysql_query($sql_lauseke,$yhteys)){
$teksti = "Virhe: " . mysql_error();
unset($ryhma);
unset($ikaluokka);
} else {
$teksti = "Tallennus onnistui.";
unset($ryhma);
unset($ikaluokka);
}
}
} else { $teksti = "Virhe! Ikäluokka puuttuu. Tarkista tiedot."; }
} else { $teksti = "Virhe! Ryhmä puuttuu. Tarkista tiedot."; }
UserMessage ($teksti);
--- End Message ---
--- Begin Message ---
William Stokes wrote:
Hello,
How can I hide error message when user enters to POST action form for first
time? I have a form for collecting and saving user data. In the code below
you can see that there are text messages for user info stored in $teksti
variables. At the end the $teksti is passed to function that displays the
message. Problem is that when user enters the page for firs time the
variables are empty and therefore basically the decisions made with variable
values result to error message at the first time.
Thanks for your advice
-Will
Here's code:
..
UserMessage ($teksti);
try something like:
if (isset($teksti) && $teksti) {
UserMessage ($teksti);
}
also note you check for the existance of the $_POST
superglobal to determine if the user actually submitted a post.
e.g.:
if (isset($_POST) && is_array($POST) && !empty($_POST)) {
// somebody submitted something from somewhere.
}
--- End Message ---
--- Begin Message ---
Richard Lynch wrote:
Can anybody expand on the meaning and correct usage of:
hi Richard,
been following your ordeal from a far, sorry to say I have
nothing useful to add regarding the curl problem ... but I was
wondering if a fopen() or file_get_contents() in conjunction
with allow_url_fopen wouldn't be a way to side step the problem?
rgds,
Jochem
--- End Message ---
--- Begin Message ---
On Wed, April 12, 2006 11:28 am, Jochem Maas wrote:
> Richard Lynch wrote:
>> Can anybody expand on the meaning and correct usage of:
>
> hi Richard,
>
> been following your ordeal from a far, sorry to say I have
> nothing useful to add regarding the curl problem ... but I was
> wondering if a fopen() or file_get_contents() in conjunction
> with allow_url_fopen wouldn't be a way to side step the problem?
I need the cookies and all that...
It's an anti-CAPTCHA ocr research thang...
I think my next step is to figure out how to run PHP source under a
debugger. Yikes. It's been 20+ years since I've done that kind of
thing...
--
Like Music?
http://l-i-e.com/artists.htm
--- End Message ---
--- Begin Message ---
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
退 [EMAIL PROTECTED] 订”内容写明您想“退 订的邮箱”)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
企业如何应对欧美客户查验工厂和实施SA8000标准
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
【主 办 单 位】希锐企管
【费-------用】1980元/人/2天(含教材、午餐、点心等)同一企业
三人以上报名均可享受9折优惠。
【上-课-时间】2OO6年4月22-23日(周六/周日两天)
【苏州会务组】苏州电话:0512-67137582 苏州传真:0512-67137583 联系人:杨小姐
深圳电话:0755-22058634 深圳传真:0755-83524349 联系人:曾小姐
上海电话:021-51083269 上海传真:021-51083269 联系人:方先生
【上-课-地点】苏州中山大厦
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
第一部分 如何应对欧美客户查验工厂
1、 欧美地区的跨国公司为何要查验工厂?
2、 查验工厂对出口型企业带来的利弊分析
3、 欧美跨国公司实施客户验厂的一般制度是什么?
4、 客户验厂的标准和依据是什么?
5、 客户验厂形式和主要流程步骤
案例:红橙黄绿的审核制度
6、 验厂前企业如何进行自评,事先改善问题
7、 验厂前企业需准备哪些验厂文件
案例:Wal-mart验厂需要提交的文件
8、 客户验厂过程中企业应重点关注的六大事项
9、 工厂现场审核的10大要点
10、验厂时企业如何安排面谈人员及组织咨询会议?
11、应对反恐调查与实地查验的方法
12、客户突击验厂时企业需要采取那些措施?
13、企业如何应对欧盟的两个指令:RoHS及WEEE
14、针对客户定期验厂企业需要准备些什么?
15、企业如何应对十分挑剔的客户
16、有效改善客户验厂时发现的问题?
17、如何构建和完善企业的内审制度,以便随时应对验厂
18、如何应对欧美客户委托第三方来查验工厂
第二部分 如何实施SA8000标准
1、 SA8000标准的产生背景及其影响
2、 欧盟各跨国公司对SA8000认证有何不同要求?
3、 跨国公司的验厂标准与SA8000标准之间的联系
4、 出口型企业应如何选择SA8000标准认证?
5、 SA8000标准九大条款剖析
6、 SA8000标准的理解与实施要点
案例:企业如何认证SA8000
7、 如何建立与运行SA8000管理体系?
8、 SA8000中内审与管理评审应如何进行
9、 SA8000社会责任体系文件的编写及范例
10、SAMS、QMS、EMS、OHSMS各体系之间应如何整合
第三部分 企业应注意的问题
1、公司的厂房结构极其安全测评
2、消防设施与安全事项
3、员工工作与生活的适宜性
4、危险物品管理与MSDS
5、现场的噪音、粉尘、辐射
6、企业的安全防护与保障能力
7、人性化管理
8、综合管理体系建设要点
案例:某韩资的SA8000认证活动
互动:自由问答
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
讲,师,介,绍:李先生
中国跟单员培训实战专家,粤港台企业管理研究中心理事长,工学硕士,高级工程师,
清华大学深圳研究院MBA,先后在美、日、韩资外企,港台独资企业从事管理工作多年,
历任工程部工程师、现场主管、品质经理、生产副总等职务,在十数载企管一线的摸爬
滚打中积累了丰富的管理经验,尤其深谙工厂生产、品质、工程方面的管理运作,对跨
国公司输入的管理思想颇有研究,形成了独具特色的实干型制造企业管理方法和体系。
李先生将历时十多年积累起来丰富的生产制造与管理经验,进行浓缩升华,于2000-2004
年间,先后出版了《杰出班组长》《品质/生产/工程……部门主管跟我学》系列丛书、
《电子行业ISO9001:2000实施技法与案例》、《卓越品质管控》、《生产现场管控》、
《仓储与物料管控》、《杰出跟单员》、《SA8000标准》等书籍等书籍,受到企业界的
高度重视并给予了极高的评价。李先生实践经验丰富、讲授过程列举大量案例、特别强
调实用性和可操作性,深受听课人员的好评和尊敬.至今李先生为满足企业的实际需要,
在全国各地成功举办了百多场讲座,授课人数达到万多人次,并为数百家企业提供过管
理咨询和顾问服务。
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
企业如何应对欧美客户查验工厂和实施SA8000标准
>我--司决--定派学--员参--加《 企业如何应对欧美客户查验工厂和实施SA8000标准》,
>请--给--予--留--位
>请传====真到0512 67137582 培--训--部收
>单位名称:____________________________________联 系 人:___________
>联系电话:_________________传真:_____________学员人数:___________
>学员姓名:__________________ 付款方式: 1.转,帐 2.现,金
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
--- End Message ---
--- Begin Message ---
On 4/12/06, Chris Westbrook <[EMAIL PROTECTED]> wrote:
> I have a problem. I'm trying to get a Google search results page via snoopy
> and then display the links of the results it returns in an application. I
> know about the fetchlinks function in snoopy, but I'm having trouble getting
> the text between the <a> and </a> tags. Yeah, I know, I should use the
> Google API, but my client doesn't want me doing that, probably because they
> might have to pay for that. any suggestions?
Try this, and read up on regular expressions - it's an essential
knowledge if you're a programmer.
$text = "this is where the contents of your search result page goes";
preg_match_all('|<a[^>]*href="([^"]+)"[^>]*>([^<]+)<\/a>|U', $text,
$links, PREG_SET_ORDER);
print_r($links);
--
Kim Christensen
[EMAIL PROTECTED]
--- End Message ---