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?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Php Form Info...
have a form, with a text input "fieldname". method POST $var = $_POST["fieldname"] $var is then used to search in mysql select * from table where jobtype like '$var%' OR jobtype like '%$var%' OR jobtype like '%$var' OR jobtype like '$var' order by date asc; basically i'm doing a search for any string that matches the searched input, being at the beginning, middle or end of the jobtype column. query works great, except when the string contains the 4-letter word 'info' such as information or informative then the mysql query breaks down and give the usual: Error performing query: 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 'ORDER BY date ASC' at line 1 Now after much debugging, i found out that the php _POST variable treats anything with info as a numner of 0 value. inf is treated as text, nformation is treated as text, but anything with info gets a 0 value. Searched php.net and couldn't find anything related to this feature, looked under security to see if it was related to that, but nothing.
Php Form Info...
have a form, with a text input "fieldname". method POST $var = $_POST["fieldname"] $var is then used to search in mysql select * from table where jobtype like '$var%' OR jobtype like '%$var%' OR jobtype like '%$var' OR jobtype like '$var' order by date asc; basically i'm doing a search for any string that matches the searched input, being at the beginning, middle or end of the jobtype column. query works great, except when the string contains the 4-letter word 'info' such as information or informative then the mysql query breaks down and give the usual: Error performing query: 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 'ORDER BY date ASC' at line 1 Now after much debugging, i found out that the php _POST variable treats anything with info as a numner of 0 value. inf is treated as text, nformation is treated as text, but anything with info gets a 0 value. Searched php.net and couldn't find anything related to this feature, looked under security to see if it was related to that, but nothing. Can anyone look into it and elaborate? create a form, then echo the value of the $_POST variable and try words that contain info in them.
Getting Info Out Of Dynamic Form
I am using the following code to produce a dynamic form. $result = mysql_query("SELECT id,weight,date FROM weekly_data WHERE weight IS NULL AND subscr_id = '$toss' AND date <= now()"); if (!$result) { die('Invalid query: ' . mysql_error()); } print"<table width=ï`%' id='catchup' border=Ɔ' cellspacing=Ɔ' cellpadding=Ɔ'>"; print "<form name='form1' id='form1' method='post' action='catchupprocess.php'>"; print"<tr>"; print"<td></td>"; print"<td>Weight</td>"; print"<td>Date</td>"; print"<td>Waist</td>"; print"<td>Measure</td>"; print"<td></td>"; print"</tr>"; while ($row = mysql_fetch_array ($result)){ //echo $result; print"<tr>"; print"<td>"; print"<input name='".$row['id']."' size=Ɗ' type='text' value='".$row['id']."'/>"; print"</td><td>"; print"<input type='text' size=ƌ' name='weight".$row['id']."' value=''/>"; print"</td><td>"; print"<input type='text' size=ཆ' value='".$row['date']."'/>"; print"</td><td>"; print"<input type='text' size=Ɖ' name='waist".$row['id']."' value=''/>"; print"</td><td>"; print"<input type='text' size=ƌ' value='$measure'/>"; print"</td><td>"; print"<input type='hidden' size=ཆ' value=''/>"; print"</td>"; print"</tr>"; } print"<tr>"; print"<td> </td>"; print"<td><input name='Reset' type='reset' value='Reset'></td>"; print"<td> </td>"; print"<td><input name='submitcatchup' type='submit' value='Submit'></td>"; print"<td> </td>"; print"</tr>"; print"</form>"; print"</table>"; ?>
Persistent Form Info
I have some forms that have different parts, and it decides which parts to display through the url ie form.php?showpart=1, showpart=2, etc. If I want to show another part and change the url all the form info goes away. I'm a self taught PHP guy, I'm decent but not amazing. My current solution is to use AJAX to write/modify a cookie everytime the user writes something and bring that in when they change the page. Is there an easier way?
Printing Out Info From A Form
I have this php function that reads a text file for input to create a form. I am trying to get the form to print out the data on a separate page, but all I get is a blank page. Am I calling the page correctly, or is this even possible to do? Code:
Populating A Form Wth Database Info
I've coded a piece of code which populates a form with data read from the database: $connection=mysql_connec ("localhost", "f2821842", "f2821842"); $result=mysql_select_db("QUERIES"); $query=mysql_query("Select * from Emp_Details where emp_num = '$employnum'"); while($row=mysql_fetch_array($query)) {$empname=$row['emp_name'];} <form name="webregform" action="webadmin2.php" method="post"> <input name="requiredname" type="text" size="30" value="<?php echo "$empname"; ?>"> </form> When I echo the $requiredname, I get spaces and no data, and I know that $empname is not a space-it does read a value in a database. 1. How can I get $requiredname to print a value?
Insert Form Info Into Database
i am trying to enter info from a form into a mysql database. when i submit the form, a new row is created, but the information isn't contained in it? any thoughts? PHP Code:
Filling Form With Database Info
I have a table with 5 fields for a tour business activity list : (1) id -table key (2) name (3)description (4)picture -text link not binary(5) country. I would like to create a form that takes all the activitys an puts it neatly down on site in checkboxes so user can select activtys.this will be linked to form mail.i would like the activitys to be seperated by the country they r in?
Validating Form Info Before Inserting It Into Database
I have been trying to create a PHP application where you can add customer contacts to a MySQL database. Now, my problem began when I created a form where the user can add in a customer's name and info to the database. In an effort to alert the user that they may be adding a customer that is already setup in the database, knowing that some of the customers may have the same names, e.g. there is more than one Bobby Ray Brown, I decided to add a script that queries the "customers" table in the database and searches for all results that match the input from the user. Code:
PHP Displaying Info Input On HTML Form
I'm in an exercise where I've created an order form in HTML. The form displays properly and allows me to input certain test order info just fine. The relevant lines in the HTML form are: Code:
Getting Form Info Into A Mysql Select Statement
I'd like to get user input from an html form into a mysql select statement. Here's where I'm stumped: $result = mysql_query("SELECT * FROM dept WHERE notes LIKE '%search-string%'",$db); I need to get the user's input into the '%search-string%' section, but I do not understand how to do this. I can hard-code a specific search string and it will work, but I want the users to be able to dynamically define the search-string. So, I created a basic html form and used the post method to grab their input, but now I can't insert that input into the mysql select statement. Any ideas? I think it should be easy, I just don't know how to do it. I've tried this: $result = mysql_query("SELECT * FROM dept WHERE notes LIKE '%$_POST["search"]%'",$db); But it doesn't work. Below is the form in html and the php file: <html> <title>Search Test</title> <head> </head> <body> <form action="search-db.php" method="POST"> <p>Enter Your Search: <input type=text name=search></p> <input type="submit"> </form> </body> </html> ----------------------------------------------------------- <html> <body> <?php $db = mysql_connect("localhost", "Anonymous"); mysql_select_db("computers",$db); $result = mysql_query("SELECT * FROM dept WHERE notes LIKE '%surplus%'",$db); echo "<table border=1> "; while ($myrow = mysql_fetch_array($result)) { printf("<tr><td><b>%s</b></td></tr> ", $myrow[notes]); } echo "</table> "; ?> </body> </html>
Upload And Email Form Info At The Same Time
I need to upload something and also have an email sent at the same time after filling out a form. So they will fill out a form, decide what they want to upload and then hit the submit button and it will upload the file to my directory, where I can get to it, and then it will also email me the information I had them fill out in the form at the same time. Is that possible? What code would I use?
Using Form To Post Info And Pic's (Warning: Unable To Fork)
I have created an admin form which allows the admin to update info and pic's to his site but I am having trouble with the update_pic script. When I pass along the form to the php script it gives me the following error message: "Warning: Unable to fork [C:WINDOWSTEMPphp30.tmp /full/path/to/joesauto/images/anime_dvd_icongif.gif] in c:inetpubwwwrootadd_data.php on line 39" This is line 39: exec("cp $picture /full/path/to/joesauto/images/$picture_name"); This is the form I used which was taken from this site. Code:
Putting Info Into A DB / Passing Info Between Pages
I have run into an issue...I have posted previously, but my scenario has changed. Here is the situation... If a user clicks on a link ('abc123' for example) I want to insert into my database some predefined information about 'abc123' - I have assigned a value that is echoed in future pages for 'abc123'. So, what I need is some mechanism to, when a user clicks 'abc123', have a pre-defined username and password be entered into the database. I need this so future pages can utilize the session values.
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:
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
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.
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.
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();
Metatags And Keyword
I was wondering wht lines or javascript can you add, so whenever i open a link on my site it will display it in the format as underneath. title keywords metaname and is there a way that it will automatically display or determine wht the best keywords are to be displayed.im using php.
Keyword Search
I attached one webpage screen shot,in that page "MYSQL" key word is identified and make it as one Ad in tooltip, I want to know how to do this one I am creating one website with forum, In forum admin can add keywords like PHP,MYSQL.JAVA, C, C++... depends upon key word i have to search all posts and highllight the text and i add tool tip like this I am trying for str_replace ,preg_replace but some of key words are like this( MAN,WOMAN,ROM ANACE) here the text MAN is highligting if the text has WOMAN it is taking inner string ....
Keyword Search
I'm trying to do a query to do a search by keywords. For example if the user searches for "Hottest restaurants in Atlanta" i want to write a query that searches that exact phrase first in a database field called keywords and if it shows up there then that record should be displayed first.. and then after do a search for EACH one of the words in a number of fields in the database and see if it shows up. here is what i have so far but it always returns the same thing. any ideas? $searchArray=explode(" ",$search); $query = "SELECT ID,name,description from restaurants WHERE keywords = '$search' OR ("; foreach($searchArray as $key){ $query = $query . " (name LIKE '%$key%' OR subType LIKE '%$key%' OR features LIKE '%$key%' OR neighborhood LIKE '%$key%' OR region LIKE '%$key%') OR";} $query = substr($query,0,strlen($query)-3); $query = $query . ") order by keywords"; any ideas?
How To Use The Keyword 'static' In PHP 4?
In the code below I'm getting a parse error on this line: static $controllerForAll = new McControllerForAll(); why does this give me a parse error? I'm running PHP 4. function & getController($callingCode=false) { // 11-27-04 - we want to get the controllerForAll variable, and we want to make // sure that it is always passed by reference. Rather than having functions do // something like this: // // global $controllerForAll; // // we instead want them to use this function. This adds a wrapper to the way we // this variable and thus allows more flexibility in changing the access later. // After all, it may not remain in global space in future versions of the // software. // 12-12-04 - we declare controllerForAll to be static, therefore the second time // this function is called it should already exist. if (is_object($controllerForAll)) { if ($callingCode) $controllerForAll->setCallingCode($callingCode); return $controllerForAll; } else { $controllerForAll = & $GLOBALS["controllerForAll"]; if (is_object($controllerForAll)) { if ($callingCode) $controllerForAll->setCallingCode($callingCode); return $controllerForAll; } else { if (class_exists("McControllerForAll")) { static $controllerForAll = new McControllerForAll(); if (is_object($controllerForAll)) { if ($callingCode) $controllerForAll->setCallingCode($callingCode); return $controllerForAll; } else { echo "Awful sorry, we were looking for a software object called 'McControllerForAll' but we were unable to find it. The software really, really needs it to work."; } } else { echo "Awful sorry, we were looking for a software object called 'McControllerForAll' but we were unable to find it. The software really, really needs it to work."; } } } }
Odd Keyword Search
I have a bit of a strange problem with a simple keyword search. The problem is that if you search for a keyword which only exists in one record, it will not return any results. There needs to be two or more records with the keyword in....which I really don't understand! Also, where there are more than 2 records, and I use mysql_num_rows to show say "10 records found for <whatever>" - the results shown is one less than displayed my the counter. Code:
Keyword Search
I want to implement a keyword search in which i need a criteria that the key words which found exact match should show at top.
Keyword Search Box?
How can I have a keyword search box - that you can actually type in a word and search for associated results?
Multiple Keyword Search
Ok, here's the scoop. This code snippet was working fine until just recently. It is possible something was upgraded on the server, but I'm not sure what the original version of mysql was. This snippet takes a multiple or single keyword search trims and explodes it, and then performs the search. The search works fine if you enter a single keyword but as soon as you enter multiple keywords the query fails. It prints out the "Query Failed" message. I changed the method= to "Get" so I could see if there were any errors and it is exactly as it should be, multiple keywords end up with a "+" between them. Suggestions? thanks chris <? //error message (not found message) $XX = "Sorry, No Records Found"; //Putting all individual words in an array if ($search) { $search = trim($search); // delete surrounding spaces $search = explode(" ", $search); // make array of individual words } //Definition of the query $selectquery = " SELECT * FROM Products "; //Cycle through the words-array if there are word(s) filled in if (isset($search)) { $selectquery .= " WHERE "; for($i=0; $i < count($search); $i++) { $selectquery .= " $column LIKE '%" . $search[$i] ."%' "; if ($i < count($search)-1) { $selectquery .= " ORDER by Description "; } } } $result = mysql_query ($selectquery) or die ("Query failed"); // this is where multiple keywords kills it while ($row = mysql_fetch_array($result)) { print statements...
Keyword Search Engine
I am working on a project where I need a keyword search that doesn't send duplicate responses and can search both a keyword and description field. I have had some luck stripping out tokens to search for the right words, but I am getting duplicate results and I am unable to sort the results.
Global Keyword Safe?
In a php script (foo.php), I include a file (db_connection.php) that contains the db connect info. I call a SELECT statement through a function in the foo.php file. Instead of passing the db connect variable to the function, is it ok to use the global keyword for the db connect in the function itself? or would this create a security issue? Is it safer to pass a variable as opposed to using the global keyword?
Keyword Search Function
I am trying to make a keyword search query that will search the table bugz in the rows email, description and subject for a user input keyword in the keyword text box on the above page. All that I have been able to come up with is the below code: $result= mysql_query ("SELECT * FROM bugz WHERE email LIKE '%$keyword_str%' or description LIKE '%$keyword_str%' or subject LIKE '%$keyword_str%'"); I would like to make it display the results the way it does when you select drop down selections to narrow your search so it just displays a table of results according to the input keyword. I would also like it to be case Insensitive.
Keyword Suggestion Tool
I use a site that allows me to put in keywords. It then comes back with a number of suggestions taken from searches done on major engines. Does anyone know where they get the information in the first place, and is there a php script - free or otherwise - that I could integrate into my own site to do this for visitors.
Tag/keyword Suggestion Service/API
I'm looking for tag/keyword suggestion service. The basic idea is that I want to pass a sentence or paragraph and have that API give me back a list of suggested keywords based on the input. I'm hoping that Yahoo or Google has something similar but so far my searches haven't gotten me anywhere. Does anyone know of such a tool? Or, if that doesn't really exist does anyone know of a good module for analyzing a string and removing "unimportant" words?
|