Page 1 of 1
Printing <?
Posted: Tue Nov 16, 2004 7:39 am
by InSion
Easy question... difficult answer?
Is there anyway to print the code "<?" ??... I don´t think
will work..... also, I need the code to be exactly <? I can´t use codes like... <...
help will we VERY appreciated.

Posted: Tue Nov 16, 2004 8:16 am
by Shendemiar
Rather annoying problem...
Re: Printing <?
Posted: Tue Nov 16, 2004 8:27 am
by BDKR
InSion wrote: I can´t use codes like... <...
Why?
Posted: Tue Nov 16, 2004 8:35 am
by timvw
i guess not everything that is outputted by php is (x)(ht)ml
this is weird:
outputs:
zut
Posted: Tue Nov 16, 2004 8:35 am
by InSion
I can´t use those codes becouse I want the code to be written in html code exactly <? ?>.... I would write it inside a javascript function and the idea is that that piece of code is executed each time the javascript function is called... now I´m thinking.... being javascript a client-side languaje is that possible??
The really proble I´m dealing with is a form which is used to make modifications to some places information of Ushuaia city, when you decide to modify, i.e. "Pizza Center" a form with it´s name, address, and all the information will be shown, taking it from a mysql database. One of the fields is the phone prefix.
I get "02901" from my database and I have to show it from a dropdown (I make it in a php function that gets the options from a mysql table)selected... It´s very difficult to explain, I can show the code here or maybe you wanna me to place it in internet so you can try it...
Posted: Tue Nov 16, 2004 8:43 am
by InSion
timvw wrote:i guess not everything that is outputted by php is (x)(ht)ml
this is weird:
outputs:
zut
mm... maybe with something like
Code: Select all
<?php echo "zut" . "<" . " " . "\d" . "?" ?>
Where "\d" is a delete-one-char code?
Posted: Tue Nov 16, 2004 8:45 am
by timvw
that outputs: zut< \d?
i (and the op) really want <?
Posted: Tue Nov 16, 2004 8:46 am
by InSion
timvw wrote:that outputs: zut< \d?
i (and the op) really want <?
Yes, \d should be remplaced with a special code from php used to delenete one char, I think there exists one, but don´t know which is it
Posted: Tue Nov 16, 2004 8:58 am
by BDKR
InSion wrote:I can´t use those codes becouse I want the code to be written in html code exactly <? ?>....
So you merely
want it this way as opposed to
needing it this way for some valid reason? What's wrong with using the special character designations?
Posted: Tue Nov 16, 2004 9:21 am
by InSion
BDKR wrote:InSion wrote:I can´t use those codes becouse I want the code to be written in html code exactly <? ?>....
So you merely
want it this way as opposed to
needing it this way for some valid reason? What's wrong with using the special character designations?
Just want the code to be <? ?>... The reason is very crazy and difficult to explain... I think that if I could write that I won´t anyway be able to do what i want... so I´m trying something different.
Anyway I think this finished being an interesant post, becouse I really want to know if that is possible in any way...
Posted: Tue Nov 16, 2004 10:07 am
by BDKR
Hmmm.... . About the only thing I can think of all the top of my head is to use the code tags around them, but then they can't be controlled by style sheets (to the best of my tired not enough sleep thinking at the moment.
Good luck otherwise. I'm not sure I can see another way around the issue.
Cheers
Posted: Tue Nov 16, 2004 11:58 am
by rehfeld
this works
Code: Select all
echo '<?php code ?>';
// or
echo '<? code ?>';
seems you gotta use a closeing tag ?> or it wont though.....
you could also make a file with nothing in it but the open tag, then either
Code: Select all
echo file_get_contents('open_tag_file.txt');
// or
readfile('open_tag_file.txt');
...
Posted: Tue Nov 16, 2004 2:14 pm
by Calimero
untested but try using some language that does not understand php code
<script language="javascript">
document.write("<");
document.write("?");
</script>
Or look trough HTML - maybe something usefull will come up.