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 Complete Forum Thread with Replies
Related Forum Messages:
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 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 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 !
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 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 !
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 !
Using A Range In Php
Hi, I am trying to create a online blood glucose level reader. I have created a page with the following text fields (which become variables on the following page). name which becomes $name glucose which becomes $glucose
View Replies !
Range Of Value
I have the following scenario. Let say I have A1, A2, A3, B3, B4, B5, MC01, MC02, MC03 I also have the following value "A1-A3" ,"MC01-MC03", "B1-B4" Let say I need to write a function to detemine A1 is belog to A1-A3, MC2 is belong to MC01-MC03, B4 is belog to "B1-B4". How could I accomplish this.
View Replies !
Range A-z + 0-9
i have a lyric page that sort artist from a-z each letter; however, i want to add 0-9 in front of a, b, c... example: 0-9 in 1 group A B C . . . Z i try to use this code, but the song title from 0-9 does not appear. Anybody know why? (again, i want my array to be like 0-9, A, B, C, D...Z). PHP Code: foreach(array_merge(array(Ɔ-9'),range('A','Z')) as $_letter)
View Replies !
Age Range
I have a field with user's date of birth. I would like to be able to show where the age fall into i.e. 25-30 years old instead of 27 years old I suppose I need to create an array with the ranges but not sure how to do the rest.
View Replies !
PHP Date Range?
Is there a way I can get PHP to echo a date range, and have it update weekly? I want it to show "Monthnow", "Datenow" - "Monththen", "Datethen" (Where Month/Datenow is the last recognized Wednesday, and Month/Datethen is the next upcoming Wednesday). Example, for the current week, the page displays: July 23 - July 30. I'd like it to update that automatically on a weekly basis, if possible, using the date/time features of PHP. (I have no database).
View Replies !
Dynamic IP Range
I do not know where posting it? Is there a way to find (and where to find it) the high end and low end of the USA dynamic IP range. I am not even sure that it is possible to get such an answer.
View Replies !
Range Of Dates
I'm trying to create a report in PHP/HTML showing all deliveries made from our database. I'd like to automatically generate a different report for each month of the year. So I need to do two things: First I need to be able to find the earliest occurence of the date in the field called date_delivered in my SQL database - is there a particular function I should be using to achieve this? And then secondly I need to automatically create a link to each month which will take the user to a page showing all deliveries that month?
View Replies !
Out Of Range Error
When I run this query on MySQL 5.0 server through PHP 4.3.10, I get an error. mysql_query("INSERT INTO `tbl_graphics` VALUES('', '$height', '$width', '$format', '$details');") or die(mysql_error()); MySQL Error: Code:
View Replies !
IP From Private Range
Is it possible to get client's IP (private, you know 10.*.. 172.16.* 192.168.*...) not proxy or NAT address (using cookies maybe) ? I saw few pages that can do this but I'm not sure if they used PHP and/or something else so here's my wuestion. any ideas how ?
View Replies !
Preg_match() To Specify A Range
How can I use preg_match() to check if a number is between two values (specifically 2004 and $currentYear, which is equal to date(Y))? The pattern must be between 2004 and $currentYear, I want to return an error for any year out of that range, so I can't simply use [0-9]{4}. code; if ( preg_match("/2004¦2005¦2006¦all/i", $_GET['year']) ) { $year = strip_tags($_GET['year']); } else { die("Please enter a year in the form of four digits between 2004 and $currentYear, or enter 'all' to see all years."); }
View Replies !
Fetch A Range
How would I go about generating a column of incrementing dates when provided a given start and end date/number of days? e.g.: 2006-05-07 2006-05-08 2006-05-09 2006-05-10 2006-05-11 2006-05-12 2006-05-13 2006-05-14 ... These dates should be in seperate rows. I know I could create a table and then have PHP automatically populate it, but I would like to know if there is a way that I could do this with just MySQL. I've done some searching, but have had trouble locating exactly what I need. Ultimately I'm going to use this table to peform a join against another table that has a date field, and I want a seperate copy of each row for every day that it coincides with.
View Replies !
Selecting A Range
How does one select a certain range of arrays without having to write them all out? I am wondering, how would one go about the following? So we have the following indexed arrays: $array[0] = "A"; $array[1] = "B"; $array[2] = "C"; $array[3] = "D"; i'd like this fantasy if statement to work: if ($array[range 0-3] != A) print "blah blah blah"; elseif ($array[range 1-2] != A) print" do de do "; of course me putting the range inside the brakets is an absolute violation and won't work, how would i go about coding this properly?
View Replies !
How To Find IP Range
Is it possible using php to find the IP block that a partucular IP belongs in? E.g. I can go to dnsstuff.org and type the IP address 209.126.158.167. This comes back with an IP range of 209.126.0.0 to 209.127.255.255 Is it possible to do this using PHP?
View Replies !
Getting Range Of Dates
I'd like to do a select on a range of dates. So for example I would like to select a week's worth of events. So for example I would like to select everything from 01/29/2006 to 02/05/2006 or something like that. My problem is for something like this how do I determine when the month changes and start over.
View Replies !
Date Range
The >= statement below returns rows, but when I add the 2nd statement I get nothing. Is there a better syntax to use with MySQL 4? The <= doesn't work by itself either. Looks like <= can't be used at all. AND CloseDateTime >= ང/01/2007' AND CloseDateTime <= ཈/31/2007'
View Replies !
Using A Range Of Numbers
I'm trying to search for a wildcard within a variable. My question is how can i set the wildcard to be a range of numbers? e.g. my wildcard range of 19968 to 40891 should match the variable "&# 36544 ;"
View Replies !
Range Or Array?
i am trying to make a set of numbers from 0,1,2,3.... up to 100 into a variable so that i can check another variable is equal to 0 to 100 problem is i could easily use array (0 , 1 , 2 , etc but this is far to big a code and when i tried range it just put 100 into the variable.
View Replies !
Boolean Range
I want to check a variable to see if it is between a range but am not quite sure how to approach this for an if tree. $a = 1; if (0 < $a < 2) { do whatever; } I tried "joining" but using two functions 0 < $a AND 2 < $a but that doesn't use 2 as a max and 0 as a min.
View Replies !
Submitting Date Range...
<?php $query="SELECT SUM(hours) from log WHERE pid='$'pid' AND uid = '$uid' AND date >= '$start_date' AND date <= '$end_date'"; ?> Does this look right? I'm gonna create a form using genDateSelector(). Eg. to allow user to select a start date and end date to view summary report for that date range only. What am I missing?
View Replies !
Displaying A Date Range
I would like to display a user specified date range e.g Monday to Monday next week or maybe Monday next month. When I have the basic function worked out I would like to get Data from a Mysql Database. here is what I have thought about. Code:
View Replies !
Selecting Date Range
How do I query a date range? I have a date column in my mysql table. I want to select a range of rows between : Ex. 2007-08-05 through 2007-08-30 . I also would like to have the page that sends the query as a form.. option value that shows all of the available dates, so i can select a from date and a to date.
View Replies !
Selecting Within A Date Range
Basically I want to list all events that are active on a particular day. The events are saved in an SQL table with a start date and a duration. The following code appears to work but only returs one event when there should be 3! Code:
View Replies !
Query Date Range
I have a table which holds a bunch of dates id datefrom dateto 1 2007-02-22 2007-03-05 2 2007-05-13 2007-06-23 3 2007-05-25 2007-07-23 the `datefrom` and `dateto` are dates in the format YYYY-MM-DD, the `datefrom` means the date the event starts and the `dateto` means the date the event ends. What I want to run a query on this table and return any rows which have todays date between the 'datefrom' and the 'dateto'. Does that make much sense?
View Replies !
Viewing Range Of Results
is there any way to view a range of results in mysql, and by that i mean is there any way i can see the first 100 results of a query or the 50th through 100th results of a query. is there any way to do that? i read about using views, but i didnt see anything about viewing a certain number of results. should i just feed my results into an array in php, and then sift through the array?
View Replies !
SELECT Rows Only Within A Certain Range
I want to find an easy way to select only rows within a certain range when I do a select. Im sure I have seen this done with a SELECT statement but cant remember if or how it was done. If not SELECT, whats the simplest way to do this? I have in the past selected all rows, and using a counter and conditional statement I will only output if within range //while shifting through the table select if (($i 10) and ($i < 21)) { //within range, output } Is this the simplest method?
View Replies !
|