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 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 Complete Forum Thread with Replies

Related Forum Messages:
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 !
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 !
Is ClibPDF Still Supported?
I've used ClibPDF for years from C, and recently attempted to visit
their website, www.fastio.com, to see if there were any new features
available. The domain still exists, but the website doesn't seem to.

Searching on ClibPDF turns up a bunch of messages to comp.lang.php, so
I assume somebody built a PHP wrapper for this library and that it was
in some kind of general use among PHP developers.

Does anybody here know the current state of the ClibPDF library, its
developer and the PHP wrapper? Has it been superseded by something
better, or is the last version (2.02?) considered good enough and bug
free enough that it's just being used as is (was)? Or has FastIO
simply folded and orphaned this package?

View Replies !
Which Databases Are Supported By PHP ?
I would like to make a study about PHP with databases, can you provide
me a list of databases PHP supports,

View Replies !
Pop-up Menu Supported
Is there a way, that when you click submit, ie: <input type=submit name=options value='Next'> a popup window opens asking you if you want to continue. if you click 'yes' it continues, if you click 'no' in does nothing.

View Replies !
Mysqli Not Supported
The books I'm using to learn PHP rely heavily on mysqli, with little or no explanation of what's happening, or how to recreate functions without mysqli support. I'm banging my head against one particular function:

Code:
<?php

function db_connect()
{
$result = new mysqli('localhost', 'bm_user', 'password', 'bookmarks');
if (!$result)
throw new Exception('Could not connect to database server');
else
return $result;
}

?>

View Replies !
Not Supported Server Signs
Anyone of you knows a script that finds and replaces unsupported server signs like ßäöü or blank fields and @ ???

View Replies !
Getrusage() Is Not Supported In This PHP Build
I get this message:

getrusage() is not supported in this PHP build

I'm living on a apache/win2000/php4.06/mysql platform. Thats 3 out of a possible 4

I have checked php.net for information on this function. My first thought was that getrusage() is not supported on windows. But php.net claims it is.

View Replies !
[ ] Operator Not Supported For Strings
I am trying to define an array in my selection results, assigning each field a row number after the data, such as: data[1], data[2], etc., but when I have a field of type 'char' in the array, I get this message: "Fatal error: [ ] operator not supported for strings".
Here is the array code:

$result_array=array();
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
$result_array[]=$row;
$type[]=$row['type'];
$id[]=$row['id'];};

The 'type' field in the database is of type 'char(1)' and the 'id' field is of type 'int(4), but I have also used varchar, and date in an array such as this, successfully.

View Replies !
Is StdClass Officially Supported By PHP ?
It can be very usefull to code:
$obj = new stdClass;
Unfortunately the few that the documentation officially tells about
this class is:
******************************
The name stdClass is used internally by Zend and is reserved. You
cannot have a class named stdClass in PHP.
http://www.php.net/manual/en/language.oop.php
******************************

It seems that some Pear packages instanciate this class.
But should we do the same for code intended for public releases?

View Replies !
PHP 4.0.5 - Function X Not Supported In This Build?
Our host servers' recently updated from PHP 404 to PHP 405, since that update, I've started getting an unsupported function error on one of the servers, but not the other.

In this case it's the "getmxrr()" function.

I get an 'unsupported' error, which claims that the function, is not supported in this 'build'. Since we work a number of domains, on several different servers, I'm wondering what the deal is.. the use of the getmxrr() function works on 1 server, but not the other, and both of the servers is running 4.0.5

So, I'm wondering, does this error mean :

1) PHP 4.0.5 does not support GetMXRR() any longer?
2) When the host compiled php 4.0.5 on the one server, they omitted the getmxrr() function from their build?

IMHO I'm thinking that "2" is what the deal is.. However, it's worth noting, that when I poll that server for installed extensions, it indicates the getmxrr() is available.

View Replies !
Global Variables Not Supported
We are switching to a new web host that does not support Global Variables. I understand this has been some what of a hot issue with the php community. Anyways, i have an index page that has the following in it:

<?

$ext = ".php";
$page = "".$page."".$ext."";
if (file_exists($page))
{
include($page);
} else {
include("splash.php");
}

?>

With Globals turned off, this does not work anymore. Could someone please help me with how I should code my pages to make this method work again?

View Replies !
Imagettftext() Is Not Working Though It's Supported,
I have created an awesome CAPTCHA, however my CAPTCHA does not work in my web host.

I have tested several times and I have found out the reason. The reason is the function imagettftext().

When I replaced imagettftext() function with imagestring(), all worked fine. I would like to know is there any way to make imagettftext() working? My host is using GD 2 or higher with all image types allowed, also freetype libraries and everything allowed. Can't understand why doesn't imagettftext() work for them. I couldn't even find that function from the disabled functions list.

imagestring() is ok all the way, except it does not have font and angle support. My CAPTCHA uses 5 different fonts randomly and have some angle with the characters so I really need this function to work!

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 !
Warning: Mail() Is Not Supported In This PHP Build
Warning: mail() is not supported in this PHP build in testmail.php on line 1

I don't remember disabling it when I compiled, and I can't find anything to
specifically enable it when compiling. I'm running PHP 4.0.6. My
sendmail_path is correct in my php.ini.

I tried recompiling php4 and apache but it seems that it isn't overwriting
the php modules. What files are used? I tried deleting the <apache 1.3.20
src>/src/modules/php4 folder.

View Replies !
Try/catch/finally First Supported In What Version Of Php?
I had some code that simply would not run in php 4.4.4. there were no error messages, no warnings, NOTHING. It seemed to be a syntax issue so i removed all the try/catch blocks and it seemed to compile/run ok. what verison of php first supported try/catch/finally?

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 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 !
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 !
Fatal Error: [] Operator Not Supported For Strings
I've got this annoying error, and trying to figure what is going on here...

This is the error: Fatal error: [] operator not supported for strings PHP Code:

View Replies !
Check If Image Generation Is Supported On My Server?
How would I check if image generation is supported on my server? I used phpinfo() but didnt know what to look for. Also, I just want to resize image when they are uploaded using PHP.

View Replies !
Fatal Error: Dl() Is Not Supported In Multithreaded Web Servers
I have WinXP Prof., Apache 2.0.39, and PHP ver. 4.2 when I try dl() function I saw error like this : "Fatal error: dl() is not supported in multithreaded Web servers - use extension statements in your php.ini ".

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 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 !
Problems With Array - Fatal Error: [] Operator Not Supported For Strings In.
PHP Code:

$_SESSION['productid'][] = $productid;

it gives me this error:

Fatal error: [] operator not supported for strings in.

View Replies !
Fatal Error: [] Operator Not Supported For Strings - Shopping Cart
I have a problem with a shopping cart . The following script receives data from the product page and adds it to the basket by putting it in an array. Code:

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 !
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 Replies !
Fatal Error: [] Operator Not Supported For Strings On Subscriber Signup Script
Fatal error: [] operator not supported for strings in /web/web_ps/thex-new/mailinglist/subscribersignup/subscriber_signup.php on line 240 PHP Code:

View Replies !
Illegal Characters In FDF File - Stream
I have been working on a php script lately that merges results from a db
and an xml source and then populates a PDF through FDF. I have gotten
nearly everything to work except multi line javascript. I have tried
both of the following attacks on the problem to no avail.

First I tried setting the set_on_import directly... then I tried to set
all the javascript in a function and then call the function on load...
both of them generate illegal characters in the stream.

Both of these examples are in a for each that contain a $counter:

$js = 'this.getField("moveinready.' . $counter . '").display =
display.visible;' . "";
$js .= 'this.getField("moveinready.' . $counter . '").display =
display.visible;' . "";
fdf_set_on_import_javascript($fdf,$js,true)

and

..........

View Replies !
Parsing Out A File Using Special Characters
I am creating a site where someone would enter data into a few text boxes, with the potential for them to be fairly long.  I am therefore saving them into a text file instead of a database. 

With these, there is a potential for someone to use the enter key in these boxes, therefore making it very difficult to just parse it out by line. I am currently trying to figure out how to parse it by special characters (or groups of characters such as "%%$$%%" or something that noone would ever type, on purpose or by accident) 

I was wondering if there was a way to parse this out by these special characters, or if there was a way to save those line returns that the people enter as something other than a line return.

View Replies !
Upload File With Special Characters
I have an upload script that works great except for when a file with special characters is used. If   eric'sfile.txt is uploaded it will do this  eric'sfile.txt  is there a way to have it remove the special characters instead?

//path to storage
$storage = 'Files';

//path name of file for storage
$uploadfile = "$storage/" . basename( $_FILES['Filedata']['name'] );

//if the file is moved successfully
if ( move_uploaded_file( $_FILES['Filedata']['tmp_name'] , $uploadfile ) ) {
echo( '1 ' . $_FILES['Filedata']['name']);

//file failed to move
}else{
echo( '0');
}

View Replies !
Removing Characters From An Uploaded File
I have a system whereby a user can upload a picture onto my server, I have this check in place to make sure they must upload a .jpg

$i=@getimagesize($_FILES['image_file']['tmp_name']);
if ($i[2]==2) {
$errortype = 0;
} else {
$errortype = 1;
}

My problem is that, if the filename contains a ' the whole system gets messed up, the apostrophe is causing the problem, is there anyway to remove it/all dissallowed characters from the filename and still run the above check on the file.

View Replies !
Wierd Characters When Displaying Content Of File
I have a txt file and when I display the content using echo some lines display correctly and some have wierd characters in between letters:

for example:

<?php
echo $lines[1];
echo $lines[2];

as a result I am getting correctly displayed first line:
1st line: Product A
2nd line: between each letter there is a square P(square)r(square)o(square)d(square) etc.

What should I do to display it correctly and why is it doing that?

View Replies !
Use Special Characters Or Spaces In The Video File.
Ok this is my problem. Im running a website that uses a youtube clone script i bought the code it all works, the problem now is when i wanna upload a video it doesn't let me use special characters or spaces in the video file.

For example

my first - video.wmv wont work

myfirst-video.wmv will work

View Replies !
File Uploading With Illegal Characters On The Filename
I'm creating a file uploading system for a project, and I came across this problem: whenever I upload a file that has a filename containing illegal characters, it truncates the filename from the instance of the illegal character onwards, so, in effect, the filename 'birdie's-heart.jpg' ends up as 's-heart.jpg' when it's uploaded.

Am I missing something?

View Replies !
Edit File, Characters Wont Show
I am editing some php files, after i have edit it to Icelandic, the characters ö,ð,æ etc wont show, only simpols, how can i fix this.

View Replies !
Save And Display Xml File With Special Characters
I've to save and display a xml file. I get the entries by a form. To managing special characters. In my case ............

View Replies !
File_get_contents - Strip All The Extra Characters And Just Have Text From The File?
when using the get_file_contents function i allow users to upload doc and txt files, but i have noticed when PHP hits unusual character in the doc or txt files it, doesn't upload properly, is there a way i could strip all the extra characters and just have text from the file?

     $filename = $files;
     $content = file_get_contents("uploaded_files/$filename");     
     $files_for_mysql = mysql_real_escape_string($content);

View Replies !
Preg_match() :: Remove Invalid Characters From The Uploaded File
regular expressions give me a lot of trouble. Here is my expression to remove invalid characters from the uploaded file's filename:

<?php
$subject = "/:*?"<>|`~!@#$%^&+={};' test01";
$pattern = "/s+|;|"|:|*|@|'|}|{|=|+|&|^|%|$|#||/|?|<|>|||`|~|!/";
echo "<font face='courier new'>".$subject."<br />";
echo preg_replace($pattern, "_", $subject)."</font>";

?>So far it works properly, and it did take some time to create. Basically what I am asking is if it looks like I am missing anything or if there is anything unnecessary in my expression.

View Replies !
Adding Newline Characters When Writing To Text File
I have a simple variable record length text file. For each record I entered manually to get started, they have a /cr and /n after line. I used notepad to create my file. I now have a PHP/HTML script which I want to be able to add, modify and delete records. I am currently working on the modify. I am using the fgets, ftell, fseek and fwrite to manage the file. When I write my record to the file and open it up in notepad, it doesn't create a new line. It appends it to the current line. Do I need to specify how many characters to write out in the fwrite? How can I insert the carriage return and newline characters so notepad will recognize them?

View Replies !

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