Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 01-07-2003, 10:28 PM
DrkFusion's Avatar
DrkFusion DrkFusion is offline
 
Join Date: Nov 2001
Posts: 1,926
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Some sort of php tag, that allows FULL html?

As you know in php, you can't use double quotes without putting for ex:
Code:
<input type=\"text\" name=\"head\">
Is there some sort of php tag, or function that you can use to parse html normally?

With the double quotes and all?
like
fullhtml("html here");
*note i made up that above
Reply With Quote
  #2  
Old 01-07-2003, 10:30 PM
DrkFusion's Avatar
DrkFusion DrkFusion is offline
 
Join Date: Nov 2001
Posts: 1,926
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Also
what is
htmlentities()
?
Reply With Quote
  #3  
Old 01-07-2003, 10:42 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by DrkFusion
Also
what is
htmlentities()
?
It converts things like " to &quot; and & to &amp; in strings, although its seems you should use htmlspecialchars(); if your not using ISO8859-1 acording to PHP.net
Reply With Quote
  #4  
Old 01-08-2003, 04:11 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Arunan, if you use ' ' around the String then you can use " in it
Reply With Quote
  #5  
Old 01-08-2003, 04:45 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Xenon
Arunan, if you use ' ' around the String then you can use " in it
but (IIRC) you then won't get variables parsed; i.e., if $test is 1, then echo 'test is $test' will not echo test is 1.
Reply With Quote
  #6  
Old 01-08-2003, 06:24 PM
DrkFusion's Avatar
DrkFusion DrkFusion is offline
 
Join Date: Nov 2001
Posts: 1,926
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I want to use normal html, no editing, with the double quotes and all, basically its like me writing normal html in a html page, but I want to incorporate it in php, what function would allow me to put html into it without having to format the html to fit php's needs.
Reply With Quote
  #7  
Old 01-08-2003, 06:35 PM
poi@nwdnb poi@nwdnb is offline
 
Join Date: Sep 2002
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You are probably aware of this, but just drop out of PHP code completely..

PHP Code:
<?php
some
.php.code.here();
?>

<html>
here is the html code
the value of $variable is <?=$variable?>
</html>

<?
more.php.code.here();
?>
And use the php echo() shortcut syntax to return the values of variables ie. <?=$somevariable?> (just enclose the variable inside of <?= ... ?>

Note to use this echo() shortcut you must have the short_open_tag configuration directive enabled.

I do not know of any specific function that would allow raw html code to be echo'd back to the browser. This is just the way this type of embedded code forces us to work i think!
Reply With Quote
  #8  
Old 01-09-2003, 01:32 AM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Untested, but try using:
PHP Code:
$example addslashes("<input type="text" name="head">"); 
Or maybe some variation of this will work.

Also untested, but there are two PHP directives in your php.ini file known as magic_quotes_gpc and magic_quotes_runtime, that basically will automatically add and strip slashes for you.
Reply With Quote
  #9  
Old 01-09-2003, 11:05 AM
DrkFusion's Avatar
DrkFusion DrkFusion is offline
 
Join Date: Nov 2001
Posts: 1,926
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Parse error: parse error, unexpected T_STRING in /home/virtual/site19/fst/var/www/html/vbnews.php on line 2

Thats the error I get, Velocd
Reply With Quote
  #10  
Old 01-09-2003, 11:05 AM
DrkFusion's Avatar
DrkFusion DrkFusion is offline
 
Join Date: Nov 2001
Posts: 1,926
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$example addslashes('<font face="verdana" color="#000000" size="2">Hi</font>');
echo 
"$example
Works...YAY Thanks Guys!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:32 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09005 seconds
  • Memory Usage 2,248KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (3)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete