Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   php/forms/posting/I NEED HELP!!!!!!!!! (http://www.chiefdelphi.com/forums/showthread.php?t=45184)

general 20-03-2006 19:35

Re: php/forms/posting/I NEED HELP!!!!!!!!!
 
Quote:

Originally Posted by MattD
Yeah, that works too. I just like to explicitly concatenate my strings. (Try saying that 3x fast..)

i don't even understand what you said

MattD 20-03-2006 19:40

Re: php/forms/posting/I NEED HELP!!!!!!!!!
 
Quote:

Originally Posted by general
i don't even understand what you said

Concatenation is the joining (or addition) or two or more strings of text. In PHP the string concatenation operator is "."

In most programming languages, when you want to add in the value of variable within a string of text, it must be concatenated with it, and not just within a string literal (everything inside the quotation marks) in order to be recognized. PHP picks up on the usage of variables inside of literals though, but I still like to use the concatenation operator. It's just a preference thing, really.

general 20-03-2006 20:05

Re: php/forms/posting/I NEED HELP!!!!!!!!!
 
Thank you, all of you for all of your help!

general 21-03-2006 20:39

Re: php/forms/posting/I NEED HELP!!!!!!!!!
 
sry got another question, Will this work?( all of the second ones are the code ex. <-- &#33--> is " ! ")

$write = str_replace("!", "!", $write);
$write = str_replace("$", "$", $write);
$write = str_replace("&", "&", $write);
$write = str_replace("'", "'", $write);
$write = str_replace("(", "(", $write);
$write = str_replace(")", ")", $write);
$write = str_replace(",", ",", $write);
$write = str_replace(";", ";", $write);
$write = str_replace("?", "?", $write);
$write = str_replace("^", "^", $write);

And will two words work in a
PHP Code:

str_replac() 


Mike 21-03-2006 21:35

Re: php/forms/posting/I NEED HELP!!!!!!!!!
 
Quote:

Originally Posted by general
sry got another question, Will this work?( all of the second ones are the code ex. <-- &#33--> is " ! ")

$write = str_replace("!", "!", $write);
$write = str_replace("$", "$", $write);
$write = str_replace("&", "&", $write);
$write = str_replace("'", "'", $write);
$write = str_replace("(", "(", $write);
$write = str_replace(")", ")", $write);
$write = str_replace(",", ",", $write);
$write = str_replace(";", ";", $write);
$write = str_replace("?", "?", $write);
$write = str_replace("^", "^", $write);

And will two words work in a
PHP Code:

str_replac() 


Use arrays instead of a ton of str_replace calls.

Example:
$bad_words = array('guy', 'dog', 'cat');
$good_words = array('male', 'canine', 'feline');
$write = str_replace($good_words, $bad_words, $write);

MattD 21-03-2006 21:44

Re: php/forms/posting/I NEED HELP!!!!!!!!!
 
Quote:

Originally Posted by general
sry got another question, Will this work?( all of the second ones are the code ex. <-- &#33--> is " ! ")

If you're looking to handle HTML entities, I would just use the htmlentities() function, rather then hard-coding every entity that you want to have replaced.

PHP Code:

$write htmlentities($writeENT_QUOTES); 


general 21-03-2006 22:38

Re: php/forms/posting/I NEED HELP!!!!!!!!!
 
oh shoooooooooooot, all the str_replace s are case sensitive!!!!!!!!!!!!!!!!!!

Mike 21-03-2006 22:49

Re: php/forms/posting/I NEED HELP!!!!!!!!!
 
Quote:

Originally Posted by general
oh shoooooooooooot, all the str_replace s are case sensitive!!!!!!!!!!!!!!!!!!

Use str_ireplace
Same thing as str_replace, but case insensitive.

general 21-03-2006 22:51

Re: php/forms/posting/I NEED HELP!!!!!!!!!
 
Quote:

Originally Posted by Mike
Use str_ireplace
Same thing as str_replace, but case insensitive.

it dosent work in my version

general 29-03-2006 14:36

Re: php/forms/posting/I NEED HELP!!!!!!!!!
 
ok so it works great, but now theres like 25 quotes. I want to make a second page so you dont have to scroll forever to get to the bottom. Do i have to make a new database or can i use the same one?


All times are GMT -5. The time now is 22:59.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi