Sending People To Specific Pages That Are Coming From Specific Pages...
I want to show some specific pages to people that comes to my site from
specific urls, I know the variable $_SERVER['HTTP_REFERER'] will be
used but how?
For ex if the visitor comes from a site that is like:
I want to send this person a specific.php . I used below code but not
worked:
<?php
if($_SERVER['HTTP_REFERER'] == "www.cominghost.com" ||
$_SERVER['HTTP_REFERER'] == "cominghost.com" ||
$_SERVER['HTTP_REFERER'] == "www2.cominghost.com"){
// Specific page html goes here
}
else
{
header("Location: index.php");
}
?>
This code not worked for some cases like if the visitor comes from
http://www.cominghost.com/account/targeturl.php or
http://cominghost.com/account/targeturl.php Ok I know the if statement
not working but How?
View Complete Forum Thread with Replies
Related Forum Messages:
Include The File On All Your Pages In A Specific Directory Recursivly
I have a configuration file called config.php" that I would like all my pages to have. The problem with it is that I have to include it in all my pages and have to specify the exact directory wherever it's located and I have my files throughout different files in the filesystem and it becomes a tedious job. So my question is, is there a way to have php include the file on all your pages in a specific directory recursivly or is there an apache setting through .htaccess that can maybe pull this off?
View Replies !
Login Script Basics? How Do I Make Specific Pages Available?
I'm fairly new to php but i've had a lot of php and C experience. I started to code a site just to help myself learn and i've started with a login script. My question to be more specific is once a user logs in, how do i make specific pages available to them? To explain better, If i write a blog, i can easily do one without a login using a MySQL database but if i wanted to make it where you can only write into a blog if you are logged in which would mean that the actual page with the form is only visible if the user is logged in.
View Replies !
Stop People From Viewing Certain Pages
if I want to stop people from viewing certain pages how would I do it? I have used if(isset($_SESSION['MembersID'])) { } else { header('location: '.$config_website_url.'/'.$config_website_url_topic.'/index.php?page=account&view=login'); } but i keep getting headers already sent message,so how would I get around this? or can't I?
View Replies !
How To Redirect People To Different Pages Depending On A Condition
Right now i have a login page in wich after you enter an existing user and ID then you are redirected to another php page wich is called infouser.php what i want is to do is before sending people to infouser.php check wich company they belong to, (on table employees_selex there`s a field called company with that info) if they are on Cemex Mexico or Cemex Central its ok if they are sent to infouser.php but if they are working with any othe companies at all then i want to send them to infouser2.php any clues on what to add to this code? Code:
View Replies !
Sending Email At A Specific Time
I was curious if someone knew how to send an email at a certain date. If i have a start date and in 3 days i want to send an email, how do i do it? For Example, Starting next monday (whatever the date is), 3 days after monday i want to send an email out, and also send another email out 3 days after that until i tell it to stop. What i'm attempting to do is sort of create an autoresponder for questions entered into the database. The user will enter their question and also enter a frequency of how long the server should wait until it sends an email to the recipient, if the question is not answered by next frequency date it will send out another email to the recipient. How can this be done properly?
View Replies !
Echo To A Specific Div On A Specific Page
Is it possible to echo something from a php file to a specific div in a different specific html file?If so, can you let me know how to specify where the data should displayed. $myName="john"; echo '$myName'//but i want to echo to a different page on a certain part of that page.
View Replies !
Sending Session Id Through Pages
i have faced problem that session_start didnt resumed the session already created but it created a new one. so i decided to send session id through pages. now i am using this code to send the SID PHP Code:
View Replies !
Compressing Pages Before Sending
basically my problem is compressing javascript files that are greater than 50 kb. i was wondering, php has ob_gzhandler, which should compress the codes below it..if i use the code below, do i need to specify the headers and tell the browser.."hey this is compressed javascript code!" for it to render correctly? PHP Code:
View Replies !
Sending Variables To Other Pages
Basicaly I'm getting information from the db with one php page, getting that info with a javascript, and displaying the result on my main page. What I need to do now, is have it so a user can select an option, using a drop-down or something, on the main page, and use that option as part of the query. user selects: Vancouver posted to php file as city php file $city = $_POST['city']; query = 'SELECT * FROM $city' This file then outputs xml, so I cant go to that page and have a redirect. I need everything to stay on the index page.
View Replies !
Sending Partial Pages?
I'd like to make a page with a sort of check list as it works. I.e. CHECKING FOR FILE... SUCCESS then a few seconds later it sends OPENING HANDLE... SUCCESS, etc. But since PHP is server-side pause() wouldn't work... it only delays the script from assembling the page before it sends it to the browser. Can I send pieces at a time so I can get this sort of checklist effect instead of waiting 20 seconds for it all to appear at once?
View Replies !
Sending Password To Different Pages While Keeping It Hidden
I'm trying to make a very simple administrator's interface for a project I'm working on. The member account information is stored in the MemberTable table and the characters of the members are stored in the CharacterTable table. On admin.php, I want the administrator to enter a password. If it's correct, he can chose what to do. He can either check out the member accounts or the characters. Basically I have 2 links to other pages (users.php and characters.php) from admin.php Here's my code:
View Replies !
Htaccess Is Sending Bots To Bogus Pages?
i use htaccess to rewrite from /product_info/product_id=00 to: Product+Category/Product_Brand.html the problem: yahoo and google are indexing pages THAT DO NOT EXIST and never have. they're indexing VALID category names, but they are also linking them to other categories. for instance: Code:
View Replies !
Avioding Expired Pages, & Carrying Data Accross Multiple Form Pages
I have a checkout/order form that consists of 6 pages, all PHP. The are linked to one another, like, after the user finishes page 1, they proceed to page 2, etc... The first two pages are submitted by a GET link, so those are not in my question. The next 4 are submitted using a <form>. Throughout all of the pages, i would probably have about 25-30 variables, things that the user has to fill out. I have two questions, 1. What would be the best way for me to keep track of all the data moving throughout the pages, like storing it from page 4, and i still need to access it on page 6. 2. I don't know if anyone could help me here, but does anyone know of a way to code around those ugly "page expired" pages, because of a submitted form. If a user needs to go back, which most likely they will, is there some sort of way for me to skip the expired page?
View Replies !
Converting Html Pages Into Dynamic Pages
I built a website in html, using Dreamweaver. I need to have a database built within these pages and the person who is going to do it told me that they will have to convert all my html pages into dynamic pages (php). Is it complicated to do this or do I just have to save my pages in php instead of html in Dreamweaver ?
View Replies !
Convert The PHP Pages To HTML Pages
how to Convert the PHP pages to HTML pages. provide me the specificaly coverting Codes or Scrpit to Converted the PHP Page to HTML page. If there in any software to convert the PHP Page to HTML pages please specify.
View Replies !
Custom Error Pages For Web Pages?
A site has the following htaccess commands in it for custom error pages: ErrorDocument 400 /error.php?code=400 ErrorDocument 401 /error.php?code=401 ErrorDocument 403 /error.php?code=403 ErrorDocument 404 /error.php?code=404 ErrorDocument 405 /error.php?code=405 ErrorDocument 500 /error.php?code=500 ErrorDocument 501 /error.php?code=501 ErrorDocument 502 /error.php?code=502 ErrorDocument 503 /error.php?code=503 ErrorDocument 504 /error.php?code=504 So, there is one error page with php code in it. Depending on the error code that Apache sends, it will display the correct error message on the website. However, if I type in http://www.domain.com/fdfdsfsdf.html I will get the error page correctly. However, if I type http://www.domain.com/fdfdsfsdf.php, it does not use the custom page, but using the default apache not found page. Is there something else I need to add to the htaccess file to make php errors use the custom page? I was told by the owner of the hosting company I work at that every time apache sees a .php extension, it automatically assumes it is a script and will not parse the correct error message for it. Does anyone know how to get .php extensions to use the custom error page on an apache server? Is there something else I can add to the htaccess file to facilitate this?
View Replies !
Including Pages In Pages
When including a page inside another (include('page.php')), is it bad for the second document to also have <head> and <body> tags etc? Im using iframes currently, and it works, but getting the page to match the content is kind of a javascript hack that only works after the page is loaded, not counting the images. So the new page loads, doesnt fit the old page size, and its changed.
View Replies !
Specific IF/Then...
I have a code that displays a value from a row in a mysql db. The code is this: echo "<td>" . $row['year'] . "</td>"; When the user submits their information, there is an option that says "hide the year I was born." Since the row for "year" is set it INT, if they choose that option it returns "0." I was wondering if there was a way to do something like if $row['year'] = "0"{ echo"hidden by request" } else{ echo "<td>" . $row['year'] . "</td>"; } but still have it work with my existing code.
View Replies !
How To Add An SPECIFIC Array
sorry if the subject isint really good to understand, now i will try to explain my best. I recently installed a hack in phpbb and that particular hack allows only 1 variable, but i want to add more than one, and i thought the best thing to do it is in an ARRAY, but i dont know how to do it in an array, the code looks something like this:
View Replies !
Getting Specific Fields From A CSV
I've been using fgetcsv to populate an HTML table with CSV data and so far it has been working great. But now I'm looking to call specific data from the table (ie: row 3, column 5), and I'm not sure fgetcsv can be used for this. Every online example of its use involves getting all the CSV data from a file as my table has done. What function should I use to get specific fields from my CSV? My table doesn't use unique ids, at least not like mysql, with a unique number identifying each row in the leftmost column. What then should I use to identify each row from which I'd like to get data? I'm making a page that describes a person based on the query string and the information in the database, in which each person has a row. So example.com/example.php?christopher+walken would bring up a page where Walken's information is listed. So I guess the ideal way to do what I want is to query the CSV for the name in the query string (Christopher Walken), then get and print the other information in the row (tall, great guy, etc). Any suggestions on this query?
View Replies !
How To Redirect With Specific Value ..?
I want that when i recieve different values from "form page" i will mail myself all the details and redirect the user to another site for CR Card payment. What i need is redirect the user to another site along with the value of total amount of package .How can I do that. I have done the first part of mailing but dont know how to do the redirection in PHP ..
View Replies !
Selecting Specific Tag
I am making a script which displays an RSS feed on my website. To do this I would like to take all the <div class="blabla"><img src="bla.jpg" alt="bla"> </div> tags and put them in front of my text. So the following string: <p>This is text blah blah blah</p> <div class="blabla"><img src="bla.jpg" alt="bla"> </div> <p>this is another text</p> should give as output: <div class="blabla"><img src="bla.jpg" alt="bla"> </div> <p>This is text blah blah blah</p> <p>this is another text</p> I tried using regular expressions, but I do not really get it done. Here is the code I use: while(ereg('/<DIV class="blabla"*>(.*?)</DIV>/i',$content, $matches)){ $img=$img.$matches[0]; $content=ereg_replace('/<DIV class="imgbar50"*>(.*?)</DIV>/i',"",$content,1); } what do i do wrong?
View Replies !
PHP Editor, Vim Specific.
Does anyone have a really good php indent file for vim? I'm working on my first really sizeable project and I'd like it to be kept as clean as possible while I'm working.
View Replies !
Specific Record From DB
I have a form which updates customer information and as default this gets started on record 1. I would like to be able to post a clientname from a previous form and then get the specific data for that customer. I am fine with the posting to seperate pages stuff but how could I get the update form to start on this record? Code:
View Replies !
Specific Pagination !
I've got some regular joe schmoe queries running ... now the totally result of these queries goes well over 2,000 records. Im looking to paginate these in a certain fashion : << Prev 1 2 3 4 5 6 7 8 9 10 Next >> Each # obviously will display the page ! but Prev and Next will jump to either previous 10 or next 10... so if im on page 4 and i hit next ! i dont want to go to page 5 but rather page 11 and display: << Prev 11 12 13 14 15 16 17 18 19 20 Next >> I hope this is doable ! if not please give me a better suggestion, a more effective and/or efficient way to be able to browse through all these records.
View Replies !
Specific Lines
I have the text file 'text.txt' and the contents of it are: CodingForums.com is not cool and i want to change only the 2nd line so the contents of text file is: CodingForums.com is very cool how would I do that? also how would I read just the 1st line?the contents text file would be: CodingForums.com is very cool
View Replies !
Specific Characters
i want to match some specific character set 10 odd characters in a user input string. i want to find all occurences of the any of such characters. i am using preg_match_all for this.the string pattern that i am giving is a regular expression having those characters i.e "ch1|ch2|ch3" but i am getting only first occurence of the the char which is there in the regular expression. where i am goin wrong and how can capture all occurences of those chars. e.g pattern- "x|y|z" string to search "this is the X string for test Z and Y are at end and are not detected" in above case the character that is matched is only X at 13th position and z and y are not matched. i want to detect presence of all 3 chars. i.e x,y as well as z. how can i achieve this.
View Replies !
Specific Include
I have read a lot of posts about the include statement and understand the majority but there is one small thing missing for me. Maybe you could help enlighten me. I read that I can include htm files or php files. Therefore I have two senarios. 1. If I include using a htm within a htm page, how much do I need to write in that htm file that will be included. Code:
View Replies !
Go To Specific Page
I have a search box, then I put in search criteria, got a returned result. When I click on to view that result, I got a page that says "you have to login first". After I login, I want my page to go to that "result page" instead of the member page. Is there a way to do that?
View Replies !
Getting Specific User
I have my login script, and I have it setup so that if they are not logged in it shows the login box, and if they are, it shows a welcome message. But how I can I get the specific username of the person who logged in, from the database? Here is my code: <?php if (!isset($_SESSION['authenticated'])) { echo "<form id="form1" name="form1" method="post" action=""> <label for="username">Username:</label> <input type="text" name="username" id="username" /> <label for="textfield">Password</label> <input type="password" name="pwd" id="pwd" /> <input name="login" type="image" src="images/login_button.jpg" id="login" value="Log in" /> </form>"; exit; } echo "Hey, welcome back $username!"; ?>
View Replies !
Get Specific Query
theres a set of links that derive from a database when a link is clicked you are fowarded to a page called list.php in this page i want to get certain information out of the database based on what link is clicked so this is how it works PHP Code:
View Replies !
Delete A Specific Row
How can i delete a specific row from a mySQL table. I want to delete Image2 (or make the value of it is nothing, NULL) <?php $con = mysql_connect("localhost","name","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("npsari_other", $con); mysql_query("DELETE Image2 FROM ads WHERE ID='$ID'"); mysql_close($con); ?> Is this code right, because it doesnt work.
View Replies !
Specific Types
Is there anyway to count just the. jpg files in a directory? Right now I am counting all the files, but there are some file types I don't want to count.
View Replies !
Specific Variables
hi i was wondering how to count specific variables in an sql database and have it echo the count in a php script. below is what i have so far. PHP Code: $query = "SELECT * FROM ibf_members WHERE mgroup"; $result = mysql_query($query) or die("Query Ruter failed"); while ($row = mysql_fetch_array($result));
View Replies !
Rows With Specific Ids
I have many rows in my database, all with ids which are not unique. I would like to count these ids and display the numbers in a loop. Like so. Row 1 (67) Row 2 (34) Row 3 (234) All ids that match the id of the row should be counted and displayed. I have tried this. $count = mysql_result(mysql_query("SELECT COUNT(*) FROM table WHERE $id=id"), 0);
View Replies !
Returning Specific
I'm new to PHP. I have a properties database (MYSQL). When I click on a specific link, the results show all the properties in the database, however what I need the results to show is not all the properties but ones that meet a certain criteria. I want it to show the ones that are listed as "Rentals" only.
View Replies !
Specific Truncating
I have a block of text stored in a variable, it's order data so it's always different. It's data that is sent back to me as is, so I can't get at what makes it up. I'm trying to get the IP address from the middle of this block of text isolated and put into a variable. The IP always follows the words IP Address:
View Replies !
Looking For A Specific Script
I need to find a script that will allow users to submit their URL to my site and be displayed in a column. Along with that I would like it to have a hit counter to show how many times that link has been clicked. A good example of what I would like is on this site. http://www.lookom.com/. On the righthand side of the page is what I would like.
View Replies !
Specific Calender
I'm a designer by trade so PHP can sometimes be a little out of my comfort zone, but thats always a good place to be, right? I have a specific and I should imagine very easy thing i need to set up. I'm making a website for a band who play a lot of live shows. I wonder if anyone has the best solution to make a list of their shows that automatically deletes a show once it's date has passed. You know the way, say, the Myspace live list works. I don't need any fancy calender graphics or anything like that. Just a self-updating list.
View Replies !
How To Write IE Specific
I have a small peice of code that i want to append as a attribute to a html element ONLY if the users browser is IE. I know how to detect the browser in JS, however i have yet to find an easy way to detect IE in php Code:
View Replies !
Specific Fields In FFD
I have a flat file database with data like the following: Code: 01|Greg|5 02|John|1 02|John|5 03|Mary|3 04|Matt|2 02|John|3 with the form being ID|Name|Hours. How can I extract just, for instance, John's hours and show that he has worked 9 hours total (1 + 5 + 3)? I have found from various sites how to display a single person's information.
View Replies !
$http_referrer Allow Access From Specific URL Only
I am trying to figure out the correct PHP coding to put on a page that will only allow access if referred by a specific URL or URLs (link from another site) and if they are not c oming from that URL(s) then they are redirected to somewhere else like yahoo, etc.
View Replies !
Targeting Specific Frame
Hi I have used frames a while ago but not since going with PHP Is there anything special with frames and PHP I seem to be having trouble with targeting a different frame I have 3 frameset "top", "side" and "main" in the side frame I grab some info from a database and create a simple anchor tag with some variables loaded into into and I want to when the anchor tag is clicked have the information loaded into the "main" frame. the link does not appear to be created correctly here is the actual code for the anchor tag.
View Replies !
Search Question - How To Get Specific
I have a search script on my site now using LIKE with wildcards on either side. The problem is that if someone searches on "APHS" which is a type of film, anything with the word photogrAPHS comes up too. Obviously because the pattern matches. However if I take off the wildcards it wont find it because its not the first word of the string. Anyone have anything thoughts on how to go about that? So that if you search on APHS is searches the whole field to see if there is a word match?
View Replies !
Destroying A Specific Session?
how to destroy the server-side data associated with a session *after* session_write_close() has been called? session_destroy() won't work after session_write_close() because there is no currently-initialized session, and the manual doesn't indicate that there's any way of telling session_destroy() to destroy the data associated with a specific sessionid, which is the only route I could think of to make this work. Calling session_start() to initialize the session a second time (in preparation for a call to session_destroy()) isn't an option, because headers have already been sent by the script.
View Replies !
|