Connecting Tech Pros Worldwide Forums | Help | Site Map

need help with generating html source from the php

shror
Guest
 
Posts: n/a
#1: Sep 26 '07
Hi every body,

I need your help in a problem am facing,
I have two forms on my website which when submitted they goto single
page (confirmation.php) and the two forms are for English and Arabic
versions and what I want to do is to create a single confirmation page
which is responsible to send the forms values.
What I want to do is that when the arabic form is submitted the
confirmation echos arabic succesful note and when english an english
successful note is echoed which is easy to do but my problem is that
the <headsection of the confirmation contains a redirection meta tag
for the home page and I want the meta tag to be generated according to
the language interface, and I dont know how to generate HTML using the
php so please if anybody could help me this will be really
appreciated.
or even to direct me to a tutorial for this situation.

Thanks for help in advance

shror


Jerry Stuckle
Guest
 
Posts: n/a
#2: Sep 26 '07

re: need help with generating html source from the php


shror wrote:
Quote:
Hi every body,
>
I need your help in a problem am facing,
I have two forms on my website which when submitted they goto single
page (confirmation.php) and the two forms are for English and Arabic
versions and what I want to do is to create a single confirmation page
which is responsible to send the forms values.
What I want to do is that when the arabic form is submitted the
confirmation echos arabic succesful note and when english an english
successful note is echoed which is easy to do but my problem is that
the <headsection of the confirmation contains a redirection meta tag
for the home page and I want the meta tag to be generated according to
the language interface, and I dont know how to generate HTML using the
php so please if anybody could help me this will be really
appreciated.
or even to direct me to a tutorial for this situation.
>
Thanks for help in advance
>
shror
>
<?php
echo "<b>This text is bold</b>\n";
?>


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Sanders Kaufman
Guest
 
Posts: n/a
#3: Sep 27 '07

re: need help with generating html source from the php


"shror" <shahirwm@gmail.comwrote in message
news:1190829223.398719.48620@22g2000hsm.googlegrou ps.com...
Quote:
Hi every body,
>
I need your help in a problem am facing,
I have two forms on my website which when submitted they goto single
page (confirmation.php) and the two forms are for English and Arabic
versions and what I want to do is to create a single confirmation page
which is responsible to send the forms values.
Quote:
What I want to do is that when the arabic form is submitted the
confirmation echos arabic succesful note and when english an english
successful note is echoed which is easy to do but my problem is that
the <headsection of the confirmation contains a redirection meta tag
for the home page and I want the meta tag to be generated according to
the language interface, and I dont know how to generate HTML using the
php so please if anybody could help me this will be really
appreciated.
or even to direct me to a tutorial for this situation.
That's difficult to impossible to say - without seeing the code.
I think it boils down to one comment - "I don't know how to generate HTML".

You could probably resolve your issue by finding the place in the code where
the META tag is generated and then to use a conditional (if-the-else) to
generate the appropriate line.


Shelly
Guest
 
Posts: n/a
#4: Sep 27 '07

re: need help with generating html source from the php



"Sanders Kaufman" <bucky@kaufman.netwrote in message
news:82NKi.37169$RX.8150@newssvr11.news.prodigy.ne t...
Quote:
"shror" <shahirwm@gmail.comwrote in message
news:1190829223.398719.48620@22g2000hsm.googlegrou ps.com...
Quote:
>Hi every body,
>>
>I need your help in a problem am facing,
>I have two forms on my website which when submitted they goto single
>page (confirmation.php) and the two forms are for English and Arabic
>versions and what I want to do is to create a single confirmation page
>which is responsible to send the forms values.
>
Quote:
>What I want to do is that when the arabic form is submitted the
>confirmation echos arabic succesful note and when english an english
>successful note is echoed which is easy to do but my problem is that
>the <headsection of the confirmation contains a redirection meta tag
>for the home page and I want the meta tag to be generated according to
>the language interface, and I dont know how to generate HTML using the
>php so please if anybody could help me this will be really
>appreciated.
>or even to direct me to a tutorial for this situation.
>
That's difficult to impossible to say - without seeing the code.
I think it boils down to one comment - "I don't know how to generate
HTML".
>
You could probably resolve your issue by finding the place in the code
where the META tag is generated and then to use a conditional
(if-the-else) to generate the appropriate line.
An interesting question occurred to me. Using the if statement outlined
previously in this thread, what happens with the echo when the desired
language reads from right to left and not left to right? Is it simply that
the entire string is captured in the quotes and so appears on the screen as
right to left? If that is the case, then what happens with word wrap?
Wouldn't it then break at the beginning of the sentence rather than in the
middle? (I have only worked on English sites).

Shelly


Sanders Kaufman
Guest
 
Posts: n/a
#5: Sep 27 '07

re: need help with generating html source from the php


"Shelly" <sheldonlg.news@asap-consult.comwrote in message
news:13fnapid7bhrdb9@corp.supernews.com...
Quote:
"Sanders Kaufman" <bucky@kaufman.netwrote in message
Quote:
Quote:
>You could probably resolve your issue by finding the place in the code
>where the META tag is generated and then to use a conditional
>(if-the-else) to generate the appropriate line.
>
An interesting question occurred to me. Using the if statement outlined
previously in this thread, what happens with the echo when the desired
language reads from right to left and not left to right?
I tend to buffer my echos until a block is fully composed.
I think there's a bunch of "ob****" stuff in PHP for that, but I just use a
variable.

Thus, the answer to your question is to do it like this:
Expand|Select|Wrap|Line Numbers
  1. if($sLanguage == "english"){
  2. $sMessage = "Good God, almighty!";
  3. } else {
  4. $sMessage = "Allah akbar!";
  5. }
  6. echo $sMessage;
  7.  
Quote:
Is it simply that the entire string is captured in the quotes and so
appears on the screen as right to left? If that is the case, then what
happens with word wrap?
I don't understand the question.
You had me up until word-wrap.
When you echo a string, as shown - it spits the result out to std_out as
composed.
There's no word-wrap unless the client is doing something like that.
Does that help answer the question?

Quote:
Wouldn't it then break at the beginning of the sentence rather than in the
middle? (I have only worked on English sites).
Huh? Not in any context I can think of.



macca
Guest
 
Posts: n/a
#6: Sep 27 '07

re: need help with generating html source from the php


Never worked with anything but English but I do know that text
direction can be controlled with CSS e.g.

p {
direction:rtl;

text-align:right
}

Sanders Kaufman
Guest
 
Posts: n/a
#7: Sep 27 '07

re: need help with generating html source from the php


"macca" <ptmcnally@googlemail.comwrote in message
news:1190903345.329646.114740@w3g2000hsg.googlegro ups.com...
Quote:
Never worked with anything but English but I do know that text
direction can be controlled with CSS e.g.
>
p {
direction:rtl;
>
text-align:right
}
That's so error-prone, it should be considered a bug, rather than a feature.
Browsers in languages that stream right-to-left already perform that
function.
So, if you use it the way you did, it'll switch the text back around the
wrong way.

Where that *is* useful is in proprietary HTML extensions, like
"<mymenu></mymenu>" which are not defined in the HTML/XHMTL spec.



Shelly
Guest
 
Posts: n/a
#8: Sep 27 '07

re: need help with generating html source from the php



"Sanders Kaufman" <bucky@kaufman.netwrote in message
news:o1PKi.9168$JD.5519@newssvr21.news.prodigy.net ...
Quote:
"Shelly" <sheldonlg.news@asap-consult.comwrote in message
news:13fnapid7bhrdb9@corp.supernews.com...
Quote:
>Is it simply that the entire string is captured in the quotes and so
>appears on the screen as right to left? If that is the case, then what
>happens with word wrap?
>
I don't understand the question.
You had me up until word-wrap.
When you echo a string, as shown - it spits the result out to std_out as
composed.
There's no word-wrap unless the client is doing something like that.
Does that help answer the question?
As one example, if you have a table of fixed column width and allow
multi-line (a not uncommon situaton), then the text will wrap. What happens
if that text is supposed to be right to left? Treating it all as a one left
to right string will cause it to wrap incorrectly. Does that help you
understand the question?
Quote:
>
>
Quote:
>Wouldn't it then break at the beginning of the sentence rather than in
>the middle? (I have only worked on English sites).
>
Huh? Not in any context I can think of.
"ggg fff eee ddd ccc bbb aaa" will wrap as, for example,

"ggg fff eee ddd"
"ccc bbb aaa"

because it assumes left to right. In a right to left language, aaa is the
the first word, bbb the second, etc. We would want it to wrap as:

"ddd ccc bbb aaa"
" ggg fff eee"

That is what I meant. How does one make that kind of thing happen. A
simple echo will wrap incorrectly.

Shelly
Quote:
>
>
>

Shelly
Guest
 
Posts: n/a
#9: Sep 27 '07

re: need help with generating html source from the php



"macca" <ptmcnally@googlemail.comwrote in message
news:1190903345.329646.114740@w3g2000hsg.googlegro ups.com...
Quote:
Never worked with anything but English but I do know that text
direction can be controlled with CSS e.g.
>
p {
direction:rtl;
>
text-align:right
}
>
Now THAT answers my question!

Shelly


Shelly
Guest
 
Posts: n/a
#10: Sep 27 '07

re: need help with generating html source from the php



"Sanders Kaufman" <bucky@kaufman.netwrote in message
news:aKPKi.952$4V6.418@newssvr14.news.prodigy.net. ..
Quote:
"macca" <ptmcnally@googlemail.comwrote in message
news:1190903345.329646.114740@w3g2000hsg.googlegro ups.com...
Quote:
>Never worked with anything but English but I do know that text
>direction can be controlled with CSS e.g.
>>
>p {
> direction:rtl;
>>
> text-align:right
>}
>
That's so error-prone, it should be considered a bug, rather than a
feature.
Browsers in languages that stream right-to-left already perform that
function.
.....and that also answers my question!

Shelly


Sanders Kaufman
Guest
 
Posts: n/a
#11: Sep 28 '07

re: need help with generating html source from the php


"Shelly" <sheldonlg.news@asap-consult.comwrote in message
news:13fnjqlt7862n23@corp.supernews.com...
Quote:
"Sanders Kaufman" <bucky@kaufman.netwrote in message
Quote:
Quote:
Quote:
>>Is it simply that the entire string is captured in the quotes and so
>>appears on the screen as right to left? If that is the case, then what
>>happens with word wrap?
>>
>I don't understand the question.
>You had me up until word-wrap.
>When you echo a string, as shown - it spits the result out to std_out as
>composed.
>There's no word-wrap unless the client is doing something like that.
>Does that help answer the question?
>
As one example, if you have a table of fixed column width and allow
multi-line (a not uncommon situaton), then the text will wrap. What
happens if that text is supposed to be right to left? Treating it all as
a one left to right string will cause it to wrap incorrectly. Does that
help you understand the question?
Yeah, I think so.
But for that - you're best answer can be found in the PHP docs at PHP.net -
if you're using PHP's wordwrap thingy.
I don't use it much.

Quote:
because it assumes left to right. In a right to left language, aaa is the
the first word, bbb the second, etc. We would want it to wrap as:
>
"ddd ccc bbb aaa"
" ggg fff eee"
>
That is what I meant. How does one make that kind of thing happen. A
simple echo will wrap incorrectly.
You'll probably have to create your own function for that.
I don't think PHP is *that* internationalized yet.


Closed Thread