Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Identifying Different Unicode/utf-8 Types Inside A Text String


I am dealing with a script that reverses a string that is in hebrew, so I can display it properly when I write that string onto an image, however sometimes the string might be half hebrew half english, so I need a way to identify what language is in the string and only reverse the hebrew parts.

in technical terms the hebrew text is encoded in utf-8, and the english text will be encoded in the normal encoding for english, (anscii, latin-swedish whatever, i dont know the name of that encoding)

so the simple question is how do I identify different types of encoding within a string?
that way I can break up the parts that i identify as being utf-8 and reverse only those

(yes I am well aware of methods to display hebrew properly in php, but when writing to an image this is another story, only method i found so far is reversing the hebew text string)




View Complete Forum Thread with Replies

Related Forum Messages:
Creating A Link Inside A String Of Text
First I want to grab a string of text from a database like so,

$query = "SELECT text FROM $database WHERE id = '$id'";

The text will look something like this,

echo "This is some text about widget nuggets and how they work";

What I want to do is put the word "widget nuggets" inside a function that will turn it into a link like this,

echo "This is some text about ". link( 'widget nuggets' ) ." and how they work";

My first thought on how to approach this would be to add some type of identifier around the text in the database I want to be turned into a link like so,

"This is some text about ^widget nuggets* and how they work"

What symbols would you use? What symbols are allowed in mysql?

Anyway, now that i've marked the text to be put inside a function what would be the best approach to searching the string for this text?

My current thought would be to count the length of the string and then do a substr search for the occurences of the characters and insert the function call in the appropriate places. I am also thinking about preg_match but I am thinking there is a better and more effecient way to do this.

View Replies !
Identifying Parts Of A String
$url = /blah/elephant/spaghetti/page.php

This gives you the whole path.

But how can you identify each directory in the url individually?

ie. I want $one to equal 'blah', $two to equal 'elephant' etc.

View Replies !
PHP - Using Mail() And Unicode Text - Text Gets Disturbed
I have the following problem. On a website there's a (simple) feedback
form. This is used also by Polish visitors who (of course) type Polish
text using special characters.

However, when I receive the text in my mailbox, all special characters
have been turned into mess......

For example: "wspólprace" is turned into "współprace".

It seems PHP is handling the Unicode-8 strings quite well (when I
'echo' the strings on the site, I see the text correctly), until the
point that it is send by using mail().

Is this a server configuration issue? Or something else?

How can I get my text to remain in Unicode?

I have this problem both on my testserver (Apache 1.3.28, PHP 4.3.2 on
Windows XP) as on my providers server (Apache under Linux).

View Replies !
Remove All Unicode From A String
I am trying to use php to remove all unicode from a string. What I am
seeing it the white question mark with a black diamond. I have tried
html_entity_decode and preg_replace but had no luck.

View Replies !
Translate String In Unicode ?
I'm trying to translate a string, actually some numbers in unicode format (4 digit for a character), do you know an easy way to do it?

View Replies !
How To Convert Any Text To Unicode?
How can I convert any text to unicode please help me

View Replies !
Convert A String To Unicode/UTF8
how to convert a ascii string to Unicode/UTF8 format?

View Replies !
Why Can't Php Write A Unicode Text File?
I can't find any way of writing a unicode, or UTF-8 format text file.
Right now i have a Unicode string that i write to the text file and
the unicode characters are replaced with ANSI question marks '?'.
Please, How do i accomplish this?

I've been searching for a solution for weeks... why has nobody even
asked this question? shouldn't it be a FAQ?

View Replies !
MySQL 5.0, FULL-TEXT Indexing And Search Arabic Data, Unicode
MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode

[This version has a couple subtle edits from the orginial I posted
on mailing.database.myodbc - I'm cross posting here on this
topic/subject related newsgroup]

I was wondering if anybody has experienced the same issues
challenges I'm experiencing I'll describe shortly. Once
resolved some fascinating and powerful multi-lingual
apps incorporating non-English/latin character sets can be
realized by many developers.

I have a Unicode utf8 English - Arabic - Hebrew - Greek (and
several other languages) database in Microsoft Excel. I KNOW
that it is Unicode utf8 data because MySQL tells me it
recognizes the encoding as such but not in the context I want.

Allow me to explain ...

I can search the Unicode utf8 encoding with no problem in
Excel. While in Excel I highlight a complete word or a
partial string of an Arabic word copy it to the clipboard
(i.e. memory). I then do a find and the process is the
same successful result as if it was an English string.

MySQL 5.0 is supposed to handle Unicode utf8

I created a MySQL database I named: languages

CREATE DATABASE languages ;

and I implemented the following command on a MySQL
command prompt:

ALTER DATABASE languages DEFAULT CHARACTER SET utf8;

No problem (so far) MySQL seemingly recognized utf8 and
accepted it. My understanding is with the ALTER command
the tables I create against languages will be utf8.

I now created a table I named mainlang which denotes it
will be the main table for my languages.

mysql>CREATE TABLE mainlang
->(
->langNumID varchar(30),
->colB varchar(30),
->colC varchar(30),
->primary key (langNumID, colB)
->);

Again so far no problem: Table successfully created.
My third column 'colC' is where the Unicode data
will be stored.

I now attempt to import the database from my
Excel file into my MySQL database as follows:

mysql>load data infile 'c:arabicdictionary.csv'
->into table mainlang
->fields terminated by ','
->lines terminated by '
'
->(langNumID, colB, colC);
ERROR 1406 (22001): Data too long for 'colC' at row 1

So what to do? I did a search and found other
people seemingly had the same problem and someone
suggested:

ALTER DATABASE languages DEFAULT CHARACTER SET cp1250;

I dropped mainlang, recreated it, redid the load and
Lo and behold ... it seemed to work. No Data too long
error occurred and when I did the following query:

mysql>select langNumID, colB, colC
->from mainlang
->where colB = ��'

I see colA have a correct numeric value, colB a
correct numeric value (4994) and for colC a string of
unintelligible characters with diacritical marks,
oomlats etc. which I know is the cp1250 encoding
interpretation of the Unicode utf8 data which is
similarly unintelligible in its own regard.

Now what I try is: do a copy of the obscure colC
cp1250 character string into the clipboard/memory
and then do the following tweak on the original
select statement to see if I can search on the
(now) cp1250 character string:

mysql>select langNumID, colB, colC
->from mainlang
->where colc = 'paste of the cp1250 character string'

The computer would not allow a paste unless I pressed
the escape key. On initiating this select command
I got an empty set (no match)

My questions are:

Has anyone been successful creating a Unicode utf8
MySQL database that accepts Arabic?

If yes, how did you get around or not encounter the
Data too long issue?

Have you tried the cp1250 (or cp1251 - same mechanics
same results) work around as I have? Are you
able to search the cp1250 character string (my colC)?
If yes, how did you successfully manage to do it?

Lastly, if I take the cp1250 encoded string and paste
it into Excel ... I can string search the cp1250
encoding with no problem.

Also, here's how I know my Unicode utf-8 data is
correct apart from my own manual cross-referencing
and being recognized by MySQL in some respect:

When I copy the Unicode utf8 encoding and try to
paste it into the select command to see what would
happen I get the following error:

ERROR 1257 (HY000): Illegal mix of collations
(cp1250_general_ci, IMPLICIT) and
(utf8_general_ci, COERCIBLE) for operation '='

So what I have here is a situation where MySQL
is recognizing Unicode utf8 encoding but not
from the respect of packing a table!

Go Figure ...

View Replies !
MIME Types That Reffer To TEXT
I am trying to validate that a file submitted through a form is a TEXT file. When I use $_FILES['userfile_PFAM']['type']=='text/plain' it works, but only for files with .txt extension.

But the user may also have a file containing text data and may not have given the .txt extension (for example I found that application/octet-stream also reffers to TEXT files).

Does anybody know which of the MIME types of PHP must I check for? The MIME types that reffer to TEXT I mean.

View Replies !
Check An Input String For Data Types
What's the best way to check to see if an input string is made of completely letters or completely numbers? I wrote this, but it doesn't seem to work. I'll follow it with an example. Code:

View Replies !
Find One String Inside Another
How can I find one string inside another. i'm looking to do something like:

if str("my sentence here", "sent") {
do something }

View Replies !
Get The Position Of A String Inside An Array.
i have got a problem with the array_search. It might be quite simple...but i doesnt work at all. I am trying to get the position of a String inside an array.

This is how one of my array looks like ($array)
Array ([0] => 1533 [1] => 4711 [2] => 3311 [3] => 1234)

snippet 1 (does not work)
$search = 4711;

$position = array_search($search , $array);
echo $position";
Result =

snippet 2 (works fine)
// $search = 4711;

$position = array_search(4711 , $array);
echo $position;
Result = 1

Why can't I use my $search inside the array_search?!
Does anyone know about this "feature" ?!

View Replies !
Get Text Info Inside Quotes
Wondering how I can do this. Say I have the following as a string. info="get this text"
how can I turn that into a php variable ie.. $info="get this text";

View Replies !
Display Text Inside Image
I created a image using

<?php
$pic=ImageCreate(20,100);
$col1=ImageColorAllocate($pic,0,0,255);
$col2=ImageColorAllocate($pic,0,0,255);
ImageFilledRectangle($pic,1,1,100,100,$col2);
ImagePNG($pic,"pic.png");
ImageDestroy($pic);
?>
<img src="pic.png" border=0>

i want to enter text inside the image. at present it create a blank image.

View Replies !
Strip Slashes From Between Two 'tags' Inside A String
I'm trying to strip slashes from between two 'tags' inside a string. For example, strip slashes from the text between {php} and {/php} tags (just made up by me for use in templates, I do realise they're not proper tags).

What I've got so far:
Code: $tmpl = preg_replace("!{php}([^{])+{/php}!e", "stripslashes('$1')", $tmpl);
which just doesn't work, or
Code: $tmpl = preg_replace("!{php}(.|s)+{/php}!e", "stripslashes('1')", $tmpl);
which loses everything.

View Replies !
Split Up A String On Any Pipe (|) Not Inside Brackets
A puzzle for you regular expression wizards out there. Looking for a regex that will split up a string like the following on any pipe (|) not inside brackets:

a b | a { b |{c | cd}} d | a b c

Correct result would be:

array ( [0] ='a b', [1] ='a { b |{c | cd}} d', [2] ='a b c')

I've found a couple that get close, but nothing that quite does what I'd like.

View Replies !
Inserting Code Inside String, Preg_replace
I have a string containing a (possibly large) block of html. I need to
insert code (an image to be precise) right after the last textual
character in the string.

This is, of course, no problem if the end
contains plain text and no html. If the string ends in HTML however, I
need to fiddle around. for example consider that the string ends like
"... lorem ipsum.</p></blockquote>". I need to insert code between
"ipsum." and "</p>".

So what kind of regular expression I need, or is there another way I
have missed, to insert code into the string, right after the last
visible character, but before the possibly following html tags (usually
ending tags such as the mentioned </p> and </blockquote>).

View Replies !
Highlighting Search Text, But Not Inside Tags
I've looked at some examples of text highlighting in this forum, and they all work fairly well. But I have a problem with my html tags. I have a site where the main body text is kept in a database text field. This text can contain some simple html. In particular urls. These urls get completely messed up with the css-tags that i insert to highlight the search words. Is there a simple regex expression that can make my script skip anything between < and >?

I am currently using the example from this thread:

View Replies !
Strip_tags Remove Text Inside Comments Tag
anyone know how to make strip_tags function does not remove the text inside '<!-- xxx -->'?

here is my code:
<?
$str = "<HTML>hello world <!-- my text --> </HTML>";
$str = strip_tags($str, "<!--");
echo $str;
?>

the results of this code prints:
"hello world"

View Replies !
Formatted Text Inside The Multiline Txtbox
how to get the text from the multi-line text box the way it was formatted by the user ? like if they made a new paragraph. right now, if i get the text from it - all the texts are always on the same line - and all the formatting made by the user is gone.

View Replies !
How To Use PHPBB Text Formatting Feature Inside Of A CMS?
Does anyone know how to use PHPBB text formatting feature inside of a CMS?

OR does anyone know how to build there own.
OR just know of any good artcles on it?

I only need a few of the features, for example:
- colour
- size
- font
- alighment- bold
- italic
- underline
bulletpoints.- URL

How do you make it so when you highlight over the word,
then click one of the buttons (url), the code then appears
within the text area?

View Replies !
Search A Text Of 10 Letters Inside A Pdf File
I would like to search a text of 10 letters inside a pdf file, is it possible because i saw we can read a numeric value.


View Replies !
Text Editor Inside A Form's Textarea
I want a text editor inside a form's textarea, So I would see html markup and html entities - just like a text editor. I also would want to be able to edit it all just like a text editor - this is done in PHPMyadmin for example. is there an easy way to do this.

View Replies !
Converting FROM Html Entities Inside TEXT VALUE Parameter
I am experiencing some very odd behaviour using a function that converts from htmlentities unhtmlentites() - equivalent to pre-made html_entity_decode() in more recent versions of php. The function works fine, but when I echo inside a form, something goes wrong. Please look at the following code, in particular the output near the bottom.

This is a survey that saves form POST information in a mysql database, that is called back to the, rather long form, to show the user what they have already answered (by outputting answers back to the form). PHP Code:

View Replies !
Paste HTML Page Inside Text Area
i want to create a newsletter or emailer form sender. and that form has a text area. can be an ordinary text area or can also be tinymce.

i want to have the text area in such a way that an HTML page can be pasted in the text area (let say the html page is jobpost.html) and send it to the email address that i specified.

View Replies !
Search For A Specific Word Inside A Text File?
Basically what i'm trying to do is when a user inputs login/password information at a login page, I want PHP to search inside verify.txt and if it finds the login/password combination then allows the user to proceed. Is this possible? And if so, which functions would I use to get the job done?

Also, how can I save the login name so that it can be passed to/included in a url?

View Replies !
String Replace :: Delete All [img] Tag In A Text String
i need a function that delete all [img] tag in a text string for sample:

$string = This is my text [img:Blue hills.jpg,align=,width=700,height=525,vspace=0,hspace=0,border=1] it's contain many [img:rings.jpg,align=,width=400,height=325,vspace=0,hspace=0,border=1] i want to delete it";

i want affter processed $string will be "This is my text it's contain many i want to delete it". and two jpg file that included in that tag will be save in a array like this: $image[0] = "Blue hills.jpg" , $image[1] = "rings.jpg" .

View Replies !
Identifying Browser
Is there a way to identify the brwser a visitor to my site is using?  I would like to include site style based on the visitor's browser.   If their us IE show layout one way, if their using Firefox show it another  way...etc...etc.

View Replies !
Identifying People
on my website i'm finding people are coming back and signing up again and again... how can i log them so i know who has logged in before. was thinking IP but does this not change per session online with dial up?

View Replies !
Identifying A Value Range
i have a form that submits to a php file, the form basically has a hidden field called number:

<input type="hidden" name="number" value="12">

i know how to read the value of that, its simply putting <?php echo $_POST['number']?> but what i want to do is check if the number is between 1 and 25 and if it is then echo A else if it is between 25-75 then echo B else if it is anything above 75 then echo C .

View Replies !
Identifying SSL Clients
I have a site that uses PHP sessions through SSL, my employer does not wish the site to require cookies so I have switched on the use_trans_sid option for users who have cookies disabled. The problem I have is stopping session hijacking.

If I am on a page "https://secure.mysite.com/page.php?PHPSESSID=XXXXX"

And I email the url to someone else they can get onto the site without being challenged for a logon. I am trying to find a way to check that the connection is still coming from the same SSL connection, e.g. by checking the clients public key, but I can't find a way to get any information about the SSL connection from PHP.

View Replies !
Identifying An Image
Ive got a tracking system which tracks how many times a user clicks on an advert on my site. At the moment all the listings are set as one so when a user clicks on that advert it gets one click. However, one of the adverts is now going to contain two images advertising two separate companies.

Ive set it up so the images and urls are different and they go to their own websites and in my tracking table i have just added an extra column called image and the number 1 goes in if image 1 is clicked on or 2 if image 2 is clicked on. However, to display this is the bit im not sure about. At the moment its displayed in a table like this:

Advert Name                Category                      Number of clicks

Advert 1                     Shopping                       257

However, if advert 1 has two images, meaning two separate companies, how can I show this in the above table?

View Replies !
Identifying The Clicked Record
i already know how to load the my list of suppliers using
mysql/php/apache, but what i would like to do now is put a link for
each and every supplier and when someone clicks it, they will
automatically go to that supplier's list of products.

i want something like this:

SUPPLIERS TABLE
supplierID, Name, Address,

AA Alfin21 1506 w. 66th street <>EDIT<>

View Replies !
Identifying Search Engines
my website is pretty much database driven and i've typically parsed the data in PHP and just output flat HTML. however, i'm trying to save some badwidth by spitting out just the critical information, and have javascript parse out the data.

however, i'm kinda worried how search engines would react to this. (especially google) would search engines ignore the keywords if they are inside javascript tags? how do i detect search engines? maybe i can just setup a special script that output's "search-engine-friendly" output.

View Replies !
Identifying The Logged On User
is there a way (in php) to identify the user name used when logging onto a mySQL database? I want to know this so that I can program a basic audit trail on edited records.

View Replies !
Identifying Black Images
I would like to be able to identify completely black images in order that I can exclude them. I am thinking I could use gdlib but I cannot find a suitable function. If I can find the rgb of the image then I can exclude it.

View Replies !
Identifying Individual Users
I know that you can identify users using an ip address. But what if you have several users with different computers in one room sharing the same ip address. Is there anyway to differentiate each individual. Is there a unique signature from the computers that can be used?

View Replies !
Identifying Off-site Links
Is there an easy way to identify off-site links using php? For example, on a forum site like phpbuilder.com, I'm looking for code to flag posts that contain: Code:

View Replies !
Identifying A Page Via Hyperlink
I have a page (product_wide.php) that displays sale items. In that page, I "include" a 2nd page that contains hyperlinks to general item categories. The hyperlinks in filternavbar point to product_wide, and display items from the category selected. I need a way, using the same hyperlinks I am using now in filternavbar, to tell, from product_wide, that it was from filternavbar that the link was clicked (as opposed to some other page in the site that takes you to product_wide. I can't change the configuration of the filternavbar url because of duplicate content issues with google.

View Replies !
String Search - Search A String Of Text & Return A TRUE Value.
I'm trying to do something pretty simple but I'm stuck on what function I need to use. Basically, I have a script where you can type a message and submit it. But I don't want people to use bad words, so if they do, it displays an error message. Example:

$string = "Fudge off!"

Let's say I don't like the word "fudge"

if ( stringcontains('fudge', $string) {
echo "No cussing!"
} else {
Post the string
}

Does that make sense? I'm basically trying to find some kind of search that will search a string of text looking for the word "fudge" and if it finds it, return a TRUE value. Does such a function exist?

View Replies !
Identifying Dynamic Form Fields
User goes to page which is a form that asks for some basic info regarding returning products for credit/exchange, and also asks for how many products are going to be returned. Upon submitting, a return authorization form is presented to them with the specified number of product fields. I now want to take the input from this form and email it to myself, as well as, display a confirmation page to the user. The problem I have is a can't say, for instance, echo "$field_name"; because field_name will get created dynamically after the user specifies how many products to return. For example, say the user says 5 products, this will generate a form with field names like:

return_code0 inv_num0 qty0 product0 cre_exch0 stockout0
return_code1 inv_num1 qty1 product1 cre_exch1 stockout1
return_code2 inv_num2 qty2 product2 cre_exch2 stockout2 and so on....

These get created with a for() loop. Once this form is submitted, how can I address the field names? Code:

View Replies !
Identifying If The User Has Placed Invalid Characters
what would the code look like if you wanted to tell the user their info they submitted into a form had invalid characters? would you use ereg?

View Replies !
Identifying Non-Supported Characters In A TTF File With GD?
I've managed to get GD working (mostly anyway) on my site - and am utilising the "imagettftext" function.

I am using this function to display individual characters on my website - with a nominated Font.

However, sometimes the characters in my StringText are not supported by the particular font that I am using ...

Directly from http://www.php.net/manual/en/function.imagettftext.php

imagettftext - "If a character is used in the string which is not supported by the font, a hollow rectangle will replace the character."

Can anyone suggest some code that would:

1) compare/look at the StringText supplied within the "imagettftext" function (in my case the StringText will comprise of a single character only)

2) where the supplied StringText (ie character) is NOT supported by the font, then I need for that character to be reported as not supported. ie. either; return a flag or skip the non-supported character entirely - rather than displaying the standard "hollow rectangle".

View Replies !
Identifying Opening Link For Database Query?
I've got a tricky problem i need to solve, i'm building a banner exchange type site in which there are already about 100 banners so i've had to code things around what already exists to a certain extent.

Now each of the banners that go out on other sites have a link on the banner which pops open a window with details of the banner. this would be fine if all my banners were gifs and jpgs but there are also swf and dcr banners so i have no real control over the actual link on the banner. up until now each banner had a html page made for it so when you clicked on a banner it would open a page banner_1.html which had the details of that banner. for obvious reasons i'm going to replace all these redundant pages and put a htaccess redirect at their url to all redirect to a common page popup.php so all details will be dealt with in one file.

ok this is fine but my problem is in this page popup.php i need to identify the link that just opened the window so that i can then get the info from the database to put on the page..

remember i can't use the url like so...
bannerpage.php?thisbanner=1

but all existing links have unique addresses, is there a way to do this, i'm pretty sure there must be but i can't get my head around it?

View Replies !
Identifying Auto Increment Values For Each Of The Fields
I have set up a database i mysql, identifying auto increment values for each of the fields (eg AdminID). I was wondering how i can set up a form which will, when i go to add a new member, have the autoincrement value already present in the field and i can continue to input the rest of my data as usual.

View Replies !
Identifying User's Pick From Selection List
I have an application that uses PHP to access a MySQL table and
extract rows which match the user's search entry. Data from the
matching rows are loaded into an HTML selection list, and the user can
scan the list and highlight a selected item.

My question: In PHP, what is the syntax for identifying which row is
highlighted?

My goal is to pass the unique row ID of the selected item to a
subsequent form where all the fields will be displayed for the user to
edit.

I already have the code that loads the selection list and the code
that displays the fields. I just need to know how to determine the
highlighted item.

I have two PHP books, and both discuss loading the selection list, but
there is no mention of what to do next.

View Replies !
Form, Type=file And Identifying By Isset()
Windows XP
PHP 4.4.2
Apache 2.2
Register_Globals = Off
Safe_Mode = On
-----------------------
Hi All,

I am having a problem getting a file browse input field to be recognized on the next page. Let me show you...

page1.php Contains a web form with a file input to attach a file using a browse button.

<form method='POST' action='page2.php' enctype='multipart/form-data'>
<input name='uploadFile1' type='file' id=uploadFile1'>

page2.php contains a validator to check the input and perform an action based on whether or not the browse input field has been populated.

// IF THE POST CONTAINS A FILE UPLOAD, PROCESS SECTION 1 IF NOT PROCESS SECTION 2.

if (isset($_POST['uploadFile1'])) {
echo "File is attached so print this.";
}

if (!isset($_POST['uploadFile1'])) {
echo "File is NOT attached so print this.";
}

If the user uses the browse button on the form page to populate the field with a file path to a file on his pc, then I expect to see the "File is attached message". However, regardless of whether someone does or does not browse a file, the message is always that they have NOT browsed a file and the variable "uploadFile1" is effectively left unpopulated.

OUTPUT
File is NOT attached so print this.

Conversley, I thought I might be able to use the _FILES variable instead of _POST, but I get the exact opposite, that the browse field is populated all the time whether or not someone has browsed a file or left the browse field blank.

if (isset($_FILES['uploadFile1'])) {
echo "File is attached so print this.";
}

if (!isset($_FILES['uploadFile1'])) {


OUTPUT

File is attached so print this.

So, I am missing something. Can someone give me some direction so that I can simply identify (with register_globals = Off) whether or not an input field (input type=file) has been populated or left blank? Is this even possible? What am I missing?

View Replies !
String Of Text
I am trying to figure out a way to have a script that runs on my site that scans the webpage of an other site for a string of text. Actually there are 4 different strings and I was going to store them into an array and then depending on what one it found then echo so and so.

Is something that would be easy to do? I kind of have an idea of how it might work but my inexperience is keeping me from figuring this out.

View Replies !
Voting System - Identifying Voter And Integrity Of The Vote
I am trying to setup a voting system for our intranet (staff awards - free text fields). I have the database adding the votes no problem. What I would like to do however is the following:

1.  It's our intranet, there is no need for each person to login so it just uses "user/user".  However I need to capture the person's login on the vote record so I can identify who voted.

2.  restrict the users to one vote each.  I have done some research and it looks like I have to create a cookie.

View Replies !
Getting Text From The Middle Of A String
I have a text file that I'm going to load into a variable. What I want to do is create a second varibale that contains the comments from the html in the text file so any time it finds <!-- it will put the text afterwards into the comment variable untill it reaches --> and then it will stop.

View Replies !
How Do I Replace Text In A String...
I have a form setup to take text from a user and insert it into a MySQL database. The problem lies when the user uses an apostrophe in his text.

The apostrophe causes the mysql_query statement to end early because it thinks the apostrophe is part of the syntax, not knowing it's only part of the value.

Example:

If the user submits the text "I'm from the Shire!" when it's submitted to MySQL it thinks the statement ends at I' and thus causes a failed query.

How can I escape or process these text strings to avoid this?

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved