php-general Digest 26 May 2010 15:01:33 -0000 Issue 6765

Topics (messages 305534 through 305550):

Re: Select Values Didn't Get Passed in From Two Different Forms
        305534 by: Edwin
        305542 by: Alice Wei
        305543 by: Ashley Sheridan
        305544 by: Bob McConnell
        305545 by: tedd

Re: iCal parsing and processing
        305535 by: Larry Garfield

batteling with mod_fcgi in virtualmin virtual host
        305536 by: Gregory Machin
        305538 by: Nilesh Govindarajan
        305539 by: Ford, Mike

getaddrinfo() - what is the equivalent php function?
        305537 by: Per Jessen

Problem in image placing
        305540 by: Amit Bobade
        305541 by: Ashley Sheridan

Re: displaying database output in a table
        305546 by: tedd

Re: Looking for PHP/Solr developer
        305547 by: Paul M Foster

Convert UTF-8 to PHP defines
        305548 by: Guus Ellenkamp
        305549 by: Ashley Sheridan

Google checkout nightmare
        305550 by: Ashley Sheridan

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 ---
Hi Adam,
I am not sure this would help but does echo command end with semi colon ;
?..... <input type="hidden" name="form2"
> value="<?php echo $end?>"/> 

Maybe the echo is having some issue? Else, you could try passing the
variables as method = get and view the variables in
Ur address bar....

regards,
Edwin.

-----Original Message-----
From: Adam Richardson [mailto:[email protected]] 
Sent: Wednesday, May 26, 2010 1:31 AM
To: [email protected]
Subject: Re: [PHP] Select Values Didn't Get Passed in From Two Different
Forms

On Tue, May 25, 2010 at 1:17 PM, Alice Wei <[email protected]> wrote:

>
> Hi,
>
>  It is kind of difficult to explain what I am trying to do here, I will
> provide the form here to give a better idea.
>
>  <ul>
>                        <li>Select the type of your starting point of
> interest:<br/>
>                                <div id="start_menu"><form
> action="test_getrss.php" name="form1" method="post">
>                                        <span><input type="radio"
> value="Apartment" name="start"
>
>  onclick="check(document.form1.start)"/> Apartment </span>
>                                        <span><input type="radio"
> value="Grocery" name="start"
>
>  onclick="check(document.form1.start)"/> Grocery </span>
>                                        <span><input type="radio"
> value="Drugstore" name="start"
>
>  onclick="check(document.form1.start)"/> Drug Store </span>
>                                </form></div></li>
>                        <li>Select the type of your ending point of
> interest:<br/>
>                                <div id="end_menu"><form
> action="test_getrss2.php" name="form2" method="post">
>                                        <span><input type="radio"
> value="Apartment" name="end"
>
>  onclick="check2(document.form2.end)"/> Apartment </span>
>                                        <span><input type="radio"
> value="Grocery" name="end"
>
>  onclick="check2(document.form2.end)"/> Grocery </span>
>                                        <span><input type="radio"
> value="Drugstore" name="end"
>
>  onclick="check2(document.form2.end)"/> Drug Store </span>
>                                </form></div></li>
>                           <form action="process.php" method="post">
>                        <li>Start Time: <input type="text" size="12"
> name="start_time"/></li>
>                        <li>Arrive Time: <input type="text" size="12"
> name="end_time"/></li>
>                        <li>Which Semster is this: <select name="semester">
>                                <option value="Fall">Fall</option>
>                                <option value="Spring">Spring</option>
>                                <option value="Summer">Summer</option>
>                        </select><br/></li>
>                        <input type="hidden" name="form1" value="<?php echo
> $start?>"/>
>                                <input type="hidden" name="form2"
> value="<?php echo $end?>"/>
>                        <li style="list-style:none"><input type="submit"
> value="Submit" name="submit"/>
>                        <input type="reset" value="Reset"
> name="reset"/></form>
>
>                </ul>
>
> For some reason, when I pass in the output with process.php, the hidden
> input does not get passed in. Here is the process.php:
>
> <?php
> //get the q parameter from URL
>
> $start_time = $_POST['start_time'];
> $end_time = $_POST['end_time'];
> $semester = $_POST['semester'];
> $form1 = $_POST['form1'];
> $form2 = $_POST['form2'];
>
> echo "Start Time " . $start_time . "<br />";
> echo "End Time " . $end_time . "<br />";
> echo "Semester " . $semester . "<br />";
> echo "Start Location " . $form1 . "<br />";
> echo "End Location " . $form2 . "<br />";
>
> ?>
>
> I get values for start_time, end_time and semester, but not the last two
> values. What have I done wrong here?
>
> Thanks for your help.
>
> Alice
>
>
> _________________________________________________________________
> The New Busy is not the old busy. Search, chat and e-mail from your inbox.
>
>
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:W
L:en-US:WM_HMP:042010_3


Where are you setting the variables $start and $end?

Adam

-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com


--- End Message ---
--- Begin Message ---
On Tue, 2010-05-25 at 15:41 -0400, Alice Wei wrote:

> Date: Tue, 25 May 2010 13:40:44 -0400
> Subject: Re: [PHP] 
Select Values Didn't Get Passed in From Two Different Forms
> 
From: [email protected]
> To: [email protected]
> 
>
 > I would like to take those values away into my third form, which 
is what you
> > see with the hidden. If they are not populated,
 then how come I could see
> > the drop down menus?
> 
>
 So you're expecting the values selected in the first two forms to
>
 populate the values of the hidden fields in the third form?  Why not
>
 wrap the whole thing in a single form?  Do test_getrss.php and
> 
test_getrss2.php perform anything useful or are they just hanging
>
 around?

No, the fields are populated in the first and second 
form, form1 and form2. What I want to do is to get the selections from 
both forms and pass them on to the third. Does this make sense? For some
 reason, the text input and the semester drop down menu result can be 
passed to process.php, but the results that I try to select from the 
first and second does not. So, the form is not passing the results of 
what I had from the radio button selections.

To illustrate, the 
second looks something like this:

echo "<select 
name='end_location'>";
while($nt=mysql_fetch_array($result)){//Array
 or records stored in $nt
echo "<option 
value=$nt[0]>$nt[0]</option>";
}
echo "</select>";

How
 can I pass the values of what I picked in end_location here to 
process.php?

Thanks for your help.

Alice
                                                                                
  
_________________________________________________________________
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with 
Hotmail. 
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5





You can only pass results from both forms if you duplicate the results of one 
in the other and then submit that one. You can't submit two forms at the same 
time. Why do they have to be two forms anyway?


Well, two of them are created with Ajax that are passed through PHP, so you 
select one drop down menu are a time, as the drop down menu comes from what you 
select from a radio button. The results are dynamically. so I don't think they 
are even created at the same time. Does this help in explaining what I am 
trying to accomplish?

Thanks.





Thanks,

Ash

http://www.ashleysheridan.co.uk




You should get the Ajax to modify the first form. It's a lot easier than 
creating a second form that uses more Ajax to duplicate any selected values 
from the first. Have a look at the JQuery library, it makes a lot of the 
Javascript end a lot easier.

  I know this is not a PHP question, but could you direct me to something more 
specific on what I should do here? I am really new to Ajax. 






Thanks,

Ash

http://www.ashleysheridan.co.uk







                                          
_________________________________________________________________
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1

--- End Message ---
--- Begin Message ---
On Wed, 2010-05-26 at 08:28 -0400, Alice Wei wrote:

> On Tue, 2010-05-25 at 15:41 -0400, Alice Wei wrote:
> 
> > Date: Tue, 25 May 2010 13:40:44 -0400
> > Subject: Re: [PHP] 
> Select Values Didn't Get Passed in From Two Different Forms
> > 
> From: [email protected]
> > To: [email protected]
> > 
> >
>  > I would like to take those values away into my third form, which 
> is what you
> > > see with the hidden. If they are not populated,
>  then how come I could see
> > > the drop down menus?
> > 
> >
>  So you're expecting the values selected in the first two forms to
> >
>  populate the values of the hidden fields in the third form?  Why not
> >
>  wrap the whole thing in a single form?  Do test_getrss.php and
> > 
> test_getrss2.php perform anything useful or are they just hanging
> >
>  around?
> 
> No, the fields are populated in the first and second 
> form, form1 and form2. What I want to do is to get the selections from 
> both forms and pass them on to the third. Does this make sense? For some
>  reason, the text input and the semester drop down menu result can be 
> passed to process.php, but the results that I try to select from the 
> first and second does not. So, the form is not passing the results of 
> what I had from the radio button selections.
> 
> To illustrate, the 
> second looks something like this:
> 
> echo "<select 
> name='end_location'>";
> while($nt=mysql_fetch_array($result)){//Array
>  or records stored in $nt
> echo "<option 
> value=$nt[0]>$nt[0]</option>";
> }
> echo "</select>";
> 
> How
>  can I pass the values of what I picked in end_location here to 
> process.php?
> 
> Thanks for your help.
> 
> Alice
>                                                                               
>   
> _________________________________________________________________
> The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with 
> Hotmail. 
> http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5
> 
> 
> 
> 
> 
> You can only pass results from both forms if you duplicate the results of one 
> in the other and then submit that one. You can't submit two forms at the same 
> time. Why do they have to be two forms anyway?
> 
> 
> Well, two of them are created with Ajax that are passed through PHP, so you 
> select one drop down menu are a time, as the drop down menu comes from what 
> you select from a radio button. The results are dynamically. so I don't think 
> they are even created at the same time. Does this help in explaining what I 
> am trying to accomplish?
> 
> Thanks.
> 
> 
> 
> 
> 
> Thanks,
> 
> Ash
> 
> http://www.ashleysheridan.co.uk
> 
> 
> 
> 
> You should get the Ajax to modify the first form. It's a lot easier than 
> creating a second form that uses more Ajax to duplicate any selected values 
> from the first. Have a look at the JQuery library, it makes a lot of the 
> Javascript end a lot easier.
> 
>   I know this is not a PHP question, but could you direct me to something 
> more specific on what I should do here? I am really new to Ajax. 
> 
> 
> 
> 
> 
> 
> Thanks,
> 
> Ash
> 
> http://www.ashleysheridan.co.uk
> 
> 
> 
> 
> 
> 
> 
>                                         
> _________________________________________________________________
> Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
> http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1


Try a google search for jquery. The first site that comes up contains
all the documentation and examples to get you started.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
From: Alice Wei

> On Tue, 2010-05-25 at 15:41 -0400, Alice Wei wrote:
> 
>> Date: Tue, 25 May 2010 13:40:44 -0400
>> Subject: Re: [PHP] 
> Select Values Didn't Get Passed in From Two Different Forms
>> 
> From: [email protected]
>> To: [email protected]
>> 
>>
> > I would like to take those values away into my third form, which 
> is what you
>> > see with the hidden. If they are not populated,
>  then how come I could see
>> > the drop down menus?
>> 
>>
>  So you're expecting the values selected in the first two forms to
>>
>  populate the values of the hidden fields in the third form?  Why not
>> 
>  wrap the whole thing in a single form?  Do test_getrss.php and
>> 
> test_getrss2.php perform anything useful or are they just hanging
>>
>  around?
> 
> No, the fields are populated in the first and second 
> form, form1 and form2. What I want to do is to get the selections from

> both forms and pass them on to the third. Does this make sense? For
some
>  reason, the text input and the semester drop down menu result can be 
> passed to process.php, but the results that I try to select from the 
> first and second does not. So, the form is not passing the results of 
> what I had from the radio button selections.
> 

Alice,

What you seem to be missing is that the browser, by design, will only
send the fields in the form that was submitted. If you want to change
that you need to either replace the browser with one you modified to act
the way you want, or change the page to combine all of the forms into
one. You can try to work around it using Javascript, but that will only
work for people that don't know enough to disable that primary infection
vector for malware.

Bob McConnell

--- End Message ---
--- Begin Message ---
At 9:17 PM -0400 5/25/10, Alice Wei wrote:
No, the fields are populated in the first and second
form, form1 and form2. What I want to do is to get the selections from
both forms and pass them on to the third. Does this make sense? For some
 reason, the text input and the semester drop down menu result can be
passed to process.php, but the results that I try to select from the
first and second does not. So, the form is not passing the results of
what I had from the radio button selections.

To illustrate, the
second looks something like this:

Alice:

No offense, but "Looking" like something isn't going to cut it.

I advise you to:

1. Show us the code. -- give us a url where your code is located.

2. Tell us what you *want* to do -- and don't show us with "it looks something like this" nonsense.

3. Get the simple stuff to work first before jumping into the harder stuff.

If you are willing to do the above, then I'll help you with your problem.

Please understand that forms are very simple with very simple rules to follow. Enhancing forms with javascript routines can become complicated very quickly. But if you can describe it, it can be done.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
Hm.  Thanks, but it looks like that's all in Python.  I'm not a parcel tongue 
so that wouldn't be much use to me in a PHP app. :-)  Thanks though.

--Larry Garfield

On Tuesday 25 May 2010 06:43:30 pm Jason Pruim wrote:
> Hi Larry,
> 
> Take a look at: http://trac.calendarserver.org/
> 
> It's Apple's open source page which includes their iCal web server...
> Maybe something can be pulled from that?  Just something to think
> about and see if it helps :)
> 
> Also... Not sure if you've looked at the CalDav protocol but that is
> what it basically runs off of so if you haven't checked it out, you
> might get some better results :)
> 
> On May 25, 2010, at 2:10 PM, [email protected] wrote:
> > Hi folks.  I am looking for a good iCal processing library (open
> > source / GPL compatible).  Unfortunately, everything I've been able
> > to find so far is half-assed, incomplete, buggy, or so horribly
> > designed that I'd be embarrassed to use it (or several of the
> > above).  I was hoping someone could recommend one that actually
> > works.  I'd prefer an OO interface as it seems a natural fit, but at
> > this point I'll settle for whatever works.
> >
> > I am not looking for an application with UI and form integration and
> > stuff.  I just want a working stand-alone parser.  (If it can be
> > ripped out of something more complete, that's fine.)
> >
> > My needs:
> > 1) Given raw data (provided by a user form that I can already
> > handle), construct iCal VEVENT information including RRULEs and
> > EXRULEs.
> > 2) Given a VCALENDAR / VEVENT object, generate the appropriate iCal
> > text string that I can write to a file or return to the browser with
> > the appropriate mime header.
> > 3) Given a VCALENDAR / VEVENT object with RRULEs and EXRULEs in it,
> > be able to say "give me the start/end dates of the next X
> > occurrences from some date" or "give me all the start/end dates of
> > occurrences until date Y".
> >
> > What I've found so far:
> >
> > http://www.kigkonsult.se/iCalcreator/ - This is the best I've found
> > so far, and it's what I'm using now.  It's missing requirement #3,
> > though, as near as I can tell.  Actually if I could add that
> > functionality to it without too much trouble I'd probably stick with
> > it, but it's non-trivial functionality.  It's also PHP 4 OO, but I
> > can deal.
> >
> > http://phpicalendar.net/ - This claims to do #3, I think, but it's
> > integrated into a web app.  The code for it is also horrific, as the
> > entire parser is build on include files that rely on global
> > variables without using any functions.  The security implications of
> > that alone scare me to death to say nothing of side effects and
> > stability.
> >
> > http://code.google.com/p/qcal/ - Documentation is sorely lacking, as
> > it is listed as "pre-alpha, real alpha to be released in January".
> > That post was made in December, and there's still no "real
> > alpha". :-)  So I can't really tell if it does what I need or not.
> >
> > A quick search turned up nothing in PEAR, and Zend Framework has
> > only a proposal from 2 years ago, not an actual library.
> >
> > Any others I don't know about?  This seems like an area that cries
> > out for a good standard library, but as of yet I haven't found one
> > that works.  Help or pointers would be much appreciated.
> >
> > --Larry Garfield
> 

--- End Message ---
--- Begin Message ---
Hi
I'm running php-cgi (PHP 5.3.2) and mod_fcgid (2.3.4-2.fc12) in SuExec
Apache (2.2.13).

I'm experiencing the following

Typical errors

[Wed May 26 03:59:57 2010] [warn] [client 60.234.169.177] mod_fcgid:
stderr: PHP Deprecated:  Function eregi_replace() is deprecated in
/home/linuxpro/public_html/vtigercrm/modules/Webmails/functions.php on
line 248, referer:
http://www.linuxpro.co.nz/vtigercrm/index.php?module=Webmails&action=index&parenttab=My%20Home%20Page

and
[Wed May 26 03:59:57 2010] [warn] [client 60.234.169.177] mod_fcgid:
stderr: PHP Fatal error:  Multiple access type modifiers are not
allowed in 
/home/linuxpro/public_html/vtigercrm/modules/FieldFormulas/expression_engine/VTExpressionEngine.inc
on line 160, referer:
http://www.linuxpro.co.nz/vtigercrm/index.php?module=Webmails&action=index&parenttab=My%20Home%20Page

and
Wed May 26 03:57:54 2010] [warn] [client 60.234.169.177] mod_fcgid:
stderr: PHP Notice:  Undefined index: file in
/home/linuxpro/public_html/vtigercrm/include/utils/utils.php on line
1000, referer: 
http://www.linuxpro.co.nz/vtigercrm/index.php?action=index&module=Home

apart from changing logging levels how should I resolve these issues.

Thanks

--- End Message ---
--- Begin Message ---
On Wed, May 26, 2010 at 1:39 PM, Gregory Machin <[email protected]> wrote:
> Hi
> I'm running php-cgi (PHP 5.3.2) and mod_fcgid (2.3.4-2.fc12) in SuExec
> Apache (2.2.13).
>
> I'm experiencing the following
>
> Typical errors
>
> [Wed May 26 03:59:57 2010] [warn] [client 60.234.169.177] mod_fcgid:
> stderr: PHP Deprecated:  Function eregi_replace() is deprecated in
> /home/linuxpro/public_html/vtigercrm/modules/Webmails/functions.php on
> line 248, referer:
> http://www.linuxpro.co.nz/vtigercrm/index.php?module=Webmails&action=index&parenttab=My%20Home%20Page
>
> and
> [Wed May 26 03:59:57 2010] [warn] [client 60.234.169.177] mod_fcgid:
> stderr: PHP Fatal error:  Multiple access type modifiers are not
> allowed in 
> /home/linuxpro/public_html/vtigercrm/modules/FieldFormulas/expression_engine/VTExpressionEngine.inc
> on line 160, referer:
> http://www.linuxpro.co.nz/vtigercrm/index.php?module=Webmails&action=index&parenttab=My%20Home%20Page
>
> and
> Wed May 26 03:57:54 2010] [warn] [client 60.234.169.177] mod_fcgid:
> stderr: PHP Notice:  Undefined index: file in
> /home/linuxpro/public_html/vtigercrm/include/utils/utils.php on line
> 1000, referer: 
> http://www.linuxpro.co.nz/vtigercrm/index.php?action=index&module=Home
>
> apart from changing logging levels how should I resolve these issues.
>
> Thanks
>
>

This has nothing to do with mod_fcgid. Its the errors in code.

-- 
Nilesh Govindarajan
Facebook: nilesh.gr
Twitter: nileshgr
Website: www.itech7.com

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On
> Behalf Of Gregory Machin
> Sent: 26 May 2010 09:10
> To: [email protected]
> 
> I'm experiencing the following

[....]

> apart from changing logging levels how should I resolve these
> issues.

At the risk of sounding flippant, by fixing the indicated PHP issues at the 
locations quoted ("in (file) on line (number)"). These are pure PHP issues, 
nothing to do with fcgi as such.

If you need more specific help, please show us the relevant PHP with each error 
-- ensure you give us enough context by quoting sufficient PHP code surrounding 
the actual problem line. 

Cheers!

Mike
 -- 
Mike Ford,
Electronic Information Developer, Libraries and Learning Innovation,  
Leeds Metropolitan University, C507, Civic Quarter Campus, 
Woodhouse Lane, LEEDS,  LS1 3HE,  United Kingdom 
Email: [email protected] 
Tel: +44 113 812 4730





To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

--- End Message ---
--- Begin Message ---
AFAICT, gethostbyname() only works for ipv4 addresses, so that one is
out - dns_get_record seems to be really for dns only, i.e. it does not
look at /etc/hosts.  Is there a hph function that essentially just
calls getaddrinfo() ?



-- 
Per Jessen, Zürich (19.1°C)


--- End Message ---
--- Begin Message ---
Hi,  I am Using PHP 5, I am trying to place an image in the black box in
proportional to that black box using the function:-  *imagecopyresampled* (
).
But image is not placing proportionally. Is their another  method to do
that. Please tell me.

-- 
Regards,
Amit

--- End Message ---
--- Begin Message ---
On Wed, 2010-05-26 at 06:35 -0500, Amit Bobade wrote:

> Hi,  I am Using PHP 5, I am trying to place an image in the black box in
> proportional to that black box using the function:-  *imagecopyresampled* (
> ).
> But image is not placing proportionally. Is their another  method to do
> that. Please tell me.
> 


What code are you using to place the image? The function you mentioned
will do what you want, but you have to ask it to do it.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
At 9:27 PM -0400 5/25/10, David Mehler wrote:
I'm trying to display mysql database output in a formatted table. My
problem is i'm getting a blank screen with no errors.
-snip-
<?php
$query = "SELECT * FROM events";

  if (!($result = @ mysql_query ($query, $db)))

displayEvents($result);
mysql_close($db);

}
?>


Not that this is the problem, but "@" suppresses error reporting.

Cheers,

tedd


--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
On Tue, May 25, 2010 at 11:46:32PM -0300, Manuel Lemos wrote:

> Hello,
> 
> on 05/25/2010 04:40 PM Walden Bay said the following:
> > We're looking for a developer that has experience with integrating Apache
> > Solr with PHP.  We currently have a PHP web system, but we'd like to build
> > in Solr to be able to search across all parts of the site.
> >
> > Does anyone have any ideas where I could go to find a PHP developer with
> > Solr experience?  Or is anyone here interested?
> >
> > Sorry if this is the wrong place to post this, but I'm not sure what the
> > appropriate place is.
> 
> No, here is fine. Not sure if you will get many candidates, as most
> people only come here to get PHP development help, not necessarily to
> look for jobs.
> 
> You may also want to post to the PHPClasses.org jobs section. So far
> over 9,000 PHP developers signed up there explicitly to get PHP job offers.
> 
> Once you post a job there, the signed up PHP developers will get an
> e-mail telling them about the job, so they can see if it is interesting
> for them to apply.
> 
> Developers can only apply if their qualifications match your job
> requirements, so you will not be flooded of resumes of unqualified people.
> 
> http://www.phpclasses.org/jobs/

Or perhaps http://phpbuilder.justtechjobs.com/
Note: I have no personal or financial connection to phpbuilder.com.

Paul

-- 
Paul M. Foster

--- End Message ---
--- Begin Message ---
We use PHP defines for defining text in different languages. As far as I 
know PHP files are supposed to be ASCII, not UTF-8 or something like that. 
What I want to make is a conversion program that would convert a given UTF-8 
file with the format

definetext1=this is a text in random UTF-8, probably arabic or similar text
definetext2=this is another text in random UTF-8, probably arabic or similar 
text

into a file with the following defines

define('definetext1',chr(<t_value>).chr(<h_value>).chr(<i_value>)...<chr(<x_value>).chr(<t_value>));
define('definetext2,chr(<t_value>).chr(<h_value>).chr(<i_value>)...<chr(<x_value>).chr(<t_value>));

Not sure if I'm using the correct chr/ord function, but I hope the above is 
clear enough to make clear what I'm looking for. Basically the output file 
should be ascii and not contain any utf-8.

Any advise? The html_special_chars did not seem to work for Vietnamese text 
I tried to convert, so something seems to get wrong with just reading an 
array of strings and converting the strings and putting them in defines. 



--- End Message ---
--- Begin Message ---
On Wed, 2010-05-26 at 22:20 +0800, Guus Ellenkamp wrote:

> We use PHP defines for defining text in different languages. As far as I 
> know PHP files are supposed to be ASCII, not UTF-8 or something like that. 
> What I want to make is a conversion program that would convert a given UTF-8 
> file with the format
> 
> definetext1=this is a text in random UTF-8, probably arabic or similar text
> definetext2=this is another text in random UTF-8, probably arabic or similar 
> text
> 
> into a file with the following defines
> 
> define('definetext1',chr(<t_value>).chr(<h_value>).chr(<i_value>)...<chr(<x_value>).chr(<t_value>));
> define('definetext2,chr(<t_value>).chr(<h_value>).chr(<i_value>)...<chr(<x_value>).chr(<t_value>));
> 
> Not sure if I'm using the correct chr/ord function, but I hope the above is 
> clear enough to make clear what I'm looking for. Basically the output file 
> should be ascii and not contain any utf-8.
> 
> Any advise? The html_special_chars did not seem to work for Vietnamese text 
> I tried to convert, so something seems to get wrong with just reading an 
> array of strings and converting the strings and putting them in defines. 
> 
> 
> 


PHP files can contain utf-8, and in-fact is the preference of most
developers I know of.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
Hi All,

I'm trying to get a custom shopping cart integrated with Google
Checkout. I've done it before with their older API, but it's changed a
lot since I last used it. The official documentation is a mix and match
of bits, and doesn't seem to follow any logical structure. The code
samples Google gives only seem to work on a PHP4 system, and bring up
countless errors on a PHP 5 system.

Has anyone integrated this successfully before, or know of any decent
PHP5 examples. I'm at my wits end, as I have to get this done today. So
far my efforts go to the sandbox area and just say:

Oops! 
Error time: 2010-05-26T14:54:24 (Coordinated Universal Time)
(4878073251f78)
We were unable to process your request.

Which doesn't much help, as that value doesn't seem to be an error code
(I get zero results when I Google it)

Any help would be appreciated!

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---

Reply via email to