404 Error Referer Script Problems
I am having trouble extracting the original referer in my 404 error script.
This is what I have so far:
1) I set the .htaccess file to the following and it works fine:
ErrorDocument 404 /404.php
2) I've tried the following variables and they all produce the same results:
$REQUEST_URI
$HTTP_REFERER
$REDIRECT_URL
3) The above mentioned variables all return "/404.php" and not the
originally requested page.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
- Check Referer - Call To Unsupported Or Undefined Function Error()
- Referer
- 404 Get Referer ?
- Referer
- Referer?
- Finding Referer In PHP
- Referer Header
- Getting Referer Of Script In PHP
- Cache And Referer
- Http Referer?
- Page Referer Not Getting Set
- IP Lookup Or HTTP Referer
- How To Keep A REFERER After Redirecting With .htaccess
- Referer Based Allow/disallow
- Dynamic Http Referer
- Referer And Keyword Info Sent Via Form?
- Zone Alarm (pro) - Block Referer
- Getting Page Referer Without Depending On User
- Email Script/Javascript Parse Error: Syntax Error, Unexpected T_STRING
- Error Reading WWW Server Response (HTTP Header). Error Code: 0
- Parse Error: Syntax Error, Unexpected T_ENCAPSED_AND_WHITESPACE, Expecting T_STR
- Parse Error: Syntax Error, Unexpected '?' In /home/**/public_html/website_
- Message Was Not SentMailer Error: SMTP Error: Data Not Accepted
- Fatal Error: PDFlib Error: Resource Category 'FontAFM'
- Parse Error: Syntax Error, Unexpected T VARIABLE In
- Fatal Error: PDFlib Error: Function 'PDF_setcolor'
- Parse Error: Syntax Error, Unexpected T_OBJECT_OPERATOR
- Fatal Error: PDFlib Error [1016] PDF_open_image_file:
- Parse Error: Syntax Error, Unexpected $end In C:wampwwwsitescismv1
- Date In Apache2's Error Log When Error Caused By PHP
- CGIWrap Error: Exec Format Error
- Parse Error: Syntax Error, Unexpected $end In ..
- Error Performing Query: You Have An Error In Your SQL Syntax Near
- Redirect Error Reported As SQL Syntax Error
- Parse Error: Syntax Error, Unexpected
- ERROR: Invalid Identifer @ 726 - MYSQL ERROR
- Error Deleting Row (error 1064)
- Parse Error: Syntax Error ?
- STRANGE "Fatal Error: Call To Undefined Function..." ERROR
- Parse Error: Parse Error, Unexpected T_STRING, Expecting ',' Or ';'
- Parse Error: Parse Error, Unexpected T_IF, Expecting ',' Or ''
- Parse Error: Parse Error, Unexpected T_LNUMBER
- Parse Error</b>: Parse Error, Unexpected T_CONSTANT_ENCAPSED_STRING I
- Parse Error: Parse Error, Unexpected T_STRING
- Parse Error: Parse Error, Unexpected T_STRING,
- Parse Error: Parse Error, Unexpected T_ELSE....
- Parse Error: Parse Error, Unexpected T_LNUMBER,
- Paging (Parse Error: Parse Error, Unexpected '.' )
- Parse Error: Parse Error, Unexpected T_STRING
Check Referer - Call To Unsupported Or Undefined Function Error()
I have a Fatal error: Call to unsupported or undefined function error() in line 24 Line 24 is: error("Unauthorized access to: $HTTP_REFERER"); What I'm doing wrong? $referers = array('mydomain.com','www.mydomain.com'); function check_referer () { global $REFERERS, $HTTP_REFERER; if ($HTTP_REFERER != "") while (list($val, $ref) = each($REFERERS)) if (preg_match("/^http://$ref/", $HTTP_REFERER)) return; error("Unauthorized access to: $HTTP_REFERER"); exit; } check_referer();
Referer
I'm looking for a way to change the refferer of the client clicking on a link to an external site. In other words, the external site should not see where the visitor is coming from, or even better, if i could manipulate the referer so that in their web-server's logs it will show as if they are coming from their own site. I've tried different ideas none of which worked.
404 Get Referer ?
Is it possible to catch the referer when using a 404 document ? for example, someone surfs to www.test.com/mkqjdfkjdfk mkdjfmqkd doesn't excist, so I want to catch this string to analyze it further on ..
Referer
Is it possible to get the page anchor name when using $_SERVER['HTTP_REFERER'];? So instead of mysite.com/one.html it'll show mysite.com/one.html#two
Referer?
I want to make something so that you can only see a page if you have been referred there by a certain page. For example www.bla.com/test.php can only be accessed if the page it was linked from was www.bla.com/test123.php. How would i go about doing this? You don't have to litrally write the code out if you don't want to, just an idea of what i have to learn/read in order to do this (i know basic php, been doing it for a while but ive had a big break so i don't remember much).
Finding Referer In PHP
I'm trying to determine the location a user has come from when they access a script of mine (a custom web logging script). I've searched the manual for 'referer' but can't find any relevant references and looking at output from phpinfo doesn't shed any light on which, if any, variables might hold info about where the user has come from.
Referer Header
I wasn't too clear about how the referer header works if sent on a php page on domain Z. Does it mean that it will send to the destination server a referer specified in the header, even if it is not the actual referer of the site? e.g. header("Referer: http://www.wanttosendthis.com"); header("Location: http://www.anothersite.com"); With anothersite.com show in it's logs the referer as wanttosendthis.com?
Getting Referer Of Script In PHP
I need to obtain the URL of the site that called one of my scripts. My code on client side looks like this: <SCRIPT type="text/javascript" src="http://example.com/scripts/apiscript.php?key=[hash of site]"> on server side, what do I have to do to get the referer (calling url), so that I can use it to calcuate the required hash?
Cache And Referer
if we click on back on this browser, this forum somehow refreshes itself. So I assume it uses something like cache. But what about sometimes, like we're filling up a form and click on submit than later realize we miss out something and this time when we click back, we get a "Warning, page had expired". So is this also using cache? If this two is the same case, how come this forum won't get affected by the expired page? For the HTTP_Referer, I'm sorry but can anyone show some example like how do we stick this function to remember every part of the click on our site link like this forum? I'm really desperate to know this answer and hope someone could just briefly go through these two functions to me (rather than send me to php.net or any site) I don't mean to repeat this and hope no one will get offended by this post. I just need a little explaination.
Http Referer?
I'm bulding this web site and I do not want other to link to my pages. I can use on every sinle page the http_referer to detect who's the referer and decide if I have to give access or not... but isn't there a better way of doing this instead of putting a piece of code on very single page ?
Page Referer Not Getting Set
I do web design for some small organizations, and one of the sites I have set up takes online conference registrations. Now, most of the time it works. In fact, every time I try it, it works fine. However, after having many complaints about it not working right, I finally discovered that some of my users do not have the page referer set when they request my page, and I was checking on the form submission page to make sure that the referer was the correct page. What could cause people to not have their referer set? What is the solution for this sort of problem? Just don't check the referer?
IP Lookup Or HTTP Referer
I want to know if there is a function that I can know the IP of a user. For HTTP_REFERER, I can get the URL from the user such as www.sony.com. BUT is there any way I can also know the IP of that?
How To Keep A REFERER After Redirecting With .htaccess
When users click on a link such as /stuff/page5.html for example, when page5.html does not exist, i need to redirect to MyScript.php using the .htaccess (this works fine) but I need to hold on to the page5.html so I can make a better 404 page (and so i can be nitified of any 404 in order to fix them). Using $HTTP_REFERER returns the original page that the user clicked on, and $REQUEST_URI returns "/stuff/My404.php". I think what I need to do is somehow redirect to My404.php?BrokenLink=page5.html in the .htaccess but i'm not sure how to do this.
Referer Based Allow/disallow
If referrer is internal (www.mysite.com), then show the page, else show an error message. Basically do not want outside link, and would prefer not to have direct link through the browser either.
Dynamic Http Referer
I have people coming to my site from the page http://www.domain.com/attn.php. If i put into the script that i should let anyone into my page coming from attn.php then if the URL is changed by the variable $check it doesnt let them in. What do i do to make sure that anyone coming from 'http://www.domain.com/attn.php?check=$anything' gets in? PHP Code:
Referer And Keyword Info Sent Via Form?
I've learned that HTTP_REFERRER, at least in my tests, returns the page visted on the current domain before the form page, not the domain visited before the current domain, so that hasn't been useful. I don't know how I would get keywords in this case. I've searched around for scripts or tutorials and have been surprised to find nothing helpful The site in question has a separate stats package, but it doesn't track converting keywords and that's really what I'm after. There isn't high volume traffic, so getting them individually via a form (rather than input into a database) isn't a problem. My question is really whether what I'm trying to do is possible with a few lines of code, or have I underestimated the complexity of the task?
Zone Alarm (pro) - Block Referer
i'm having troble with a script where i check referer, on a PC with Zone Alarm Pro the referer isn't send... i did a couple of page of testing and no referer is sand, closing ZAP the referer will work How can i solve this, do you know wich option is in zone alarm that dosen't
Getting Page Referer Without Depending On User
I NEED the page referer for a script i've built to work, basicly i'm redirecting to my frames page with a line like this.. if ($m == "find") { $mainframe = $_SERVER['HTTP_REFERER']; } but i've been told that this data is sent from the user, so i need some way of telling my script which page to use as the main frame.
Email Script/Javascript Parse Error: Syntax Error, Unexpected T_STRING
I've made a email script to include javascript. Now what I want to do, is that I want to hide the link in status bar when I hover over it. I've implemented javascript into the code but I keep getting the following error: Parse error: syntax error, unexpected T_STRING in /home/****/public_html/fbmail/contact.php on line 12 Here is line 12: $message .= '<a href="http://www.mysite.com/" onMouseOver="window.status='Click here to continue.'; return true;" onMouseOut="window.status=''; ">Click here to continue ..</a>'; The complete code:
Error Reading WWW Server Response (HTTP Header). Error Code: 0
I have been trying out the web based email program on this website to connect to a pop 3 client...it worked ok...but now when i try to logg in all i get is this error message...on the page Error occurred! Description: Error reading WWW server response (HTTP Header). Error code: 0(0 = client terminated the connection unexpectedly, 2 = too many header lines) Code:
Fatal Error: PDFlib Error: Resource Category 'FontAFM'
I've searched and have yet to find out what my problem is with this script loading a font. If some one could shed some light on this I would really appreciate it. Here is the error message I'm receiving when using pdf_findfont(). Fatal error: PDFlib error: Resource category 'FontAFM' not found in /Users/namaste/Sites/make_pdf.php on line 9 My fonts and pdflib.upr reside in /fonts and the path variable in the pdflib.upr file is set to //fonts PHP Code:
Parse Error: Syntax Error, Unexpected T VARIABLE In
I can't figure this out I am posting the script as well if you see something wrong please send an email. ===================================== <?php $nume = $_POST['nume'] $prenume = $_POST['prenume'] $adresa = $_POST['adresa'] $telefon = $_POST['telefon'] $mobil = $_POST['mobil'] $A = $_POST['A'] $B = $_POST['B'] $C = $_POST['C'] $CE = $_POST['C+E'] $D = $_POST['D'] $zi = $_POST['zi'] $luna = $_POST['luna'] $an = $_POST['an'] $email = $_POST['email'] $comentarii = $_POST['comentarii'] $ip = getenv("REMOTE_ADDR"); $msg = "Nume: $nume Prenume: $prenume Adresa: $adresa Telefon fix: $telefon Mobil: $mobil Categoria A: $A CategoriaB: $B CategoriaC: $C CategoriaC+E: $CE CategoriaD: $D Data Nasterii: $zi-$luna-$an IP: $ip"; $to = "email@example.com"; $subj = "candidat nou"; $from = "www.example.com"; mail ($to, $subj, $msg, $from); header("Location: success.htm"); } ?> =================================== error is Parse error: syntax error, unexpected T_VARIABLE in D:xampphtdocsestauto schoolsite_flashsend.php on line 4
Fatal Error: PDFlib Error: Function 'PDF_setcolor'
When trying to create simple pfd files with php I got stick on the following error : I got in my php code : pdf_rect($pdf, 110, 600, 20, 30); pdf_setrgbcolor_fill($pdf, 0, 0, 1.0); pdf_fill($pdf); It would simple create an rectangle and fills it blue in the pdf file. Only when i try to execute it, it outputs : "Fatal error: PDFlib error: function 'PDF_setcolor' must not be called in 'path' scope" Someone got an idea what could be wrong?
Parse Error: Syntax Error, Unexpected T_OBJECT_OPERATOR
I got following error: Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /xxx/xxx/public_html/xxxx/GeteBayOfficialTime.php on line 49 what's wrong with my syntax? GeteBayOfficialTime.php required be runned at PHP 5.x.x., but my web host said support php 4.4.4. I don't know whether I got error because this reason. Code:
Fatal Error: PDFlib Error [1016] PDF_open_image_file:
I'm using the following function PDF_open_image_file($p, "jpeg", "../images/hviewlogo.jpg"); I'm 100% sure theis file exists.But it shows the following error Fatal error: PDFlib error [1016] PDF_open_image_file: Couldn't open JPEG file '../images/hviewlogo.jpg' for reading (file not found) in C:Inetpubwwwroot\_hqsiteextraincludespdflib.php on line 56
Parse Error: Syntax Error, Unexpected $end In C:wampwwwsitescismv1
I keep getting a "Parse error: syntax error, unexpected $end in c:wampwwwsitescismv1contacts.php on line 227". Line 227 is the end of my code. From what I can tell from searching the web, it appears that there is something that is not concantenated correctly. I cannot find it though. Can anyone else see it?
Date In Apache2's Error Log When Error Caused By PHP
I've noticed since moving from Apache1/mod_php4/linux to Apache2/mod_php5/linux that when an error is produced by PHP and put in the error_log, the date is no longer logged as well: Apache1/php4/linux example in Apache error_log: [Thu Jan 8 15:06:52 2004] [error] PHP Warning: opendir(/foo/bar/): failed to open dir: No such file or directory in /blah/something/listing.html on line 84 Apache2/php5/linux example in Apache error_log: [client 1.2.3.4] PHP Notice: Undefined variable: browserline in /foo/bar/zing.html on line 18 Is there any way to restore this, either at PHP or Apache level?
CGIWrap Error: Exec Format Error
This message usually indicates there is a problem with the script itself. Often this indicates either that the #! line of the script is incorrect, or the script was uploaded in binary mode instead of ascii mode. Check to make sure that the script does not have control-M's at the end of every line. That will prevent it from executing. An easy fix that takes care of this most of the time is to put '#!/.../perl --' instead of '#!/.../perl' on the first line of the script. This is typically a problem if the script was edited or uploaded from a DOS/Windows/Macintosh station to a unix based server. If you are not the owner of this script, please forward this error and the URL that caused it to the script owner. That is often the component in the URL right after /cgiwrap/. does anybody know what does this message means?
Parse Error: Syntax Error, Unexpected $end In ..
The error message Parse error: syntax error, unexpected $end in FILE on line X is one I run into frequently and I know the cause is I missed an ending quote. Is there an easy way to determine where the inital " started? I find myself adding /* */ blocks or cutting/pasting sections of code out in order to find where the error occured. Wouldn't it it be nice if the warning message included the line in teh source where the initial quote occured? for example say this is my code <? function Build_Query(....) code... $my_query = "SELECT BLAH FROM ; (line 15) more code... } (line 100) EOF and you got Parse error: syntax error, unexpected $end in MYFILE on line 100 started on line 15
Error Performing Query: You Have An Error In Your SQL Syntax Near
I have a query which pulls user info from a database table, and displays it in an HTML table. The user then has the ability to edit this data on the next page by clicking continue, where the first and last name are passed as variables, and are listed as uneditable, whereas all the other fields are able to be edited through a simple form. Here's my problem, on the final page where the actual database UPDATE occurs, I'm getting a SQL error that looks like this --------- Error performing query: You have an error in your SQL syntax near 'WHERE first_name='Joe' AND last_name='Schmoe' SET street_address_1='real address' at line 1 ---------- It looks like its passing the first and last name fine (through hidden inputs), yet when I start to pass the edited fields as variables, it cuts off for some reason. The actual full value that I entered for "street_address_1" was "real address 333". It looks like it cut off after the "address", and didnt even bother to send the other 8 fields. My code on the processing page looks like this ---------- $street_address_1_update=$_POST['street_address_1_update']; $street_address_2_update=$_POST['street_address_2_update']; $city_update=$_POST['city_update']; $sql ="UPDATE mailing_list WHERE first_name='$first_name_update' AND last_name='$last_name_update' SET street_address_1='$street_address_1_update' street_address_2='$street_address_2_update' city='$city_update'" ---------- I only included 3 fields for brevity's sake. The rest pass the same way as these three. Again, the first and last names are simply passed as hidden inputs through the form. Anybody have any clue what might be causing this? I know the error is a SQL one, but I may not be passing the variables correctly in PHP.
Redirect Error Reported As SQL Syntax Error
I just spent way too much time trying to track down an error that was incorrectly reported just now, and I would like to see if someone can explain to me why it was reported that way. The purpose of the code is simply to delete a record and then redirect back to the page where the delete was started. The code looks like this: elseif ($_GET[action] == "delete") { $query = "delete from product_subcategory2 where product_sku=$_GET[product_sku] and subcategory2_id=$_GET[subcategory2_id]"; $result = mysql_query($query) or die (mysql_error()); $affected_rows = mysql_affected_rows(); if ($affected_rows == 1) { header("Location:product.php?action=edit&product_sku=$product_sku"); } else { do_header(); echo("<center><p class="body">Unable to delete Subcategory2. Please try again.</p>"); echo("<a href="product.php?action=edit&product_sku=$product_sku">Edit Product</a>"); do_footer(); } } The SQL was find, but the error I had was in the header line. What I had was this: header("Location:product.php?action=edit&product_sku=<?php echo $product_sku?>"); so since I was already in PHP, I didn't need the "<?php echo" for $product_sku.
ERROR: Invalid Identifer @ 726 - MYSQL ERROR
I am trying to insert this query, I inserted it directly with SQL in phpmyadmin to see what the exact error was I'm running SQL 4 QuoteError There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem ERROR: Invalid Identifer @ 726 Code:
Error Deleting Row (error 1064)
I am running this sql statement: $query = "DELETE FROM customer WHERE cust_id = " .$custID; I get "error 1064 : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2" This doesn't make sense to me, since in the same script I have: $query = "SELECT * FROM customer WHERE cust_id = " . $custID; and it works just fine? I tried hardcoding the custID and the delete query worked just fine, how can I get it to work with my variable?
Parse Error: Syntax Error ?
Does anyone know what this means? The file it is saying user.php is a class file however i think i got all the opening and closing braces. QuoteParse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /*/*/*/*/includes/user.php on line 10
STRANGE "Fatal Error: Call To Undefined Function..." ERROR
why strange you ask? here goes: I have been working with Php and Mysql for a week without any problems. Today I tried executing a php page that connects to mysql and creates a new database, I got this error: "Fatal error: Call to undefined function mysql_connect() in C:Program FilesApache GroupApache2 est\_debug_tmp.php on line 3". I did some reading on the net and checked all my configuration, and it looks o.k. (and it already worked well a whole week before today). The strange thing is that I have another form that inserts data into the same database in Mysql, and it works like a charm (needless to say but both pages log in with the same username to the same database).
Parse Error: Parse Error, Unexpected T_IF, Expecting ',' Or ''
I'm playing around with PHP's imap functions and I'm encountering a syntax error that I can't figure out completely. Quote: Parse error: parse error, unexpected T_IF, expecting ',' or '' in /home/kingmike/docs/WEBMAIL/inbox.php on line 53 PHP Code:
Parse Error: Parse Error, Unexpected T_LNUMBER
what's wrong with this code? line 19: if($_POST['miners']*500+$_POST['magicians']*800+$_POST['knights']*1200+$_POST['rangers']*1500>$fdatabase['gold']){echo("false!");} I got error: Parse error: parse error, unexpected T_LNUMBER in /home/www/xyz.php on line 19
Parse Error: Parse Error, Unexpected T_STRING
I have edited a php script to pick up the data from a webform and convert it into a email and when i submit it i get a error..... Parse error: parse error, unexpected T_STRING in /home/nas01l/f/flexamatic.com/user/htdocs/estore/sendmail9.php on line 6 the php is:
Parse Error: Parse Error, Unexpected T_STRING,
Can a class define a constant as Java or C does? I tried to define a constant by define("AMAZING_VALUE", "1997"); but it prompts: Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}'
Parse Error: Parse Error, Unexpected T_ELSE....
The code is: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Club</title> </head> <style type="text/css"> body {margin : 0px;} </style> <body bgcolor="navy"> <font color="white"> Welkom in de winkel. Wat wilt u doen?<br> <form action="club.php" method="post"> <input type="radio" name="keuzewinkel" value="1">Voer kopen<br> <input type="radio" name="keuzewinkel" value="2">Bijproducten kopen<br> <input type="radio" name="keuzewinkel" value="3">Medicijnen kopen<br> <input type="radio" name="keuzewinkel" value="4">Praatje maken met de verkoper<br> <input type="radio" name="keuzewinkel" value="5">Duiven verkopen / kopen<br>  <br> <input type="submit" value="Verder"> </form> <? if (isset($submit)) { if ($keuzewinkel == Ƈ') include('koopvoer.php') else ($keuzewinkel == ƈ') include('koopbijproducten.php') <-- Line 25!!!! else ($keuzewinkel == Ɖ') include('koopmedicijnen.php') else ($keuzewinkel == Ɗ') include('chatverkoper.php') else include('koopduiven.php') } ?> </body> </html>
Parse Error: Parse Error, Unexpected T_LNUMBER,
i got a proplem with my array the error message is : Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in D:xampphtdocsworksmartcontractorssites est.php on line 5 PHP Code:
Paging (Parse Error: Parse Error, Unexpected '.' )
I am trying to page my database records using php and i have written the script but somehow it is giving some weird error somewhee towards the end of the script. can anyone just check the code and tell me whether this will work(give a little attention to the A HREF tag) and how to remove the error that i am getting . The error that I am getting is "Parse error: parse error, unexpected '.' in c:webpaging2.php on line 62" code:
Parse Error: Parse Error, Unexpected T_STRING
keep getting this errorParse error: parse error, unexpected T_STRING in order_fns.php line 91. the code is below for the file and I've indicated line 91 <?php function process_card($card_details) { // connect to payment gateway or // use gpg to encrypt and mail or // store in DB if you really want to return true; } function insert_order($order_details) { global $HTTP_SESSION_VARS; //extract order_details out as variables extract($order_details); //set shipping address same as address if(!$ship_name&&!$ship_address&&!$ship_city&&!$ship_state&&!$ship_zip&&!$ship_country) { $ship_name = $name; $ship_address = $address; $ship_city = $city; $ship_state = $state; $ship_zip = $zip; $ship_country = $country; } $conn = db_connect(); //insert customer address $query = "select customerid from customers where name = '$name' and address = '$address' and city = '$city' and state = '$state' and zip = '$zip' and country = '$country'"; $result = mysql_query($query); if(mysql_numrows($result)>0) { $customer_id = mysql_result($result, 0, 'customerid'); } else { $query = "insert into customers values ('', '$name','$address','$city','$state','$zip','$count ry')"; $result = mysql_query($query); if (!$result) return false; } $query = "select customerid from customers where name = '$name' and address = '$address' and city = '$city' and state = '$state' and zip = '$zip' and country = '$country'"; $result = mysql_query($query); if(mysql_numrows($result)>0) $customerid = mysql_result($result, 0, 'customerid'); else return false; $date = date('Y-m-d'); $query = "insert into orders values ('', $customerid, ".$HTTP_SESSION_VARS['total_price'].", '$date', 'PARTIAL', '$ship_name', '$ship_address','$ship_city','$ship_state','$ship_ zip', '$ship_country')"; $result = mysql_query($query); if (!$result) return false;
|