How Can I SELECT Results Visible To Crawlers?
I have seen a few site search result pages come up in Google etc. when similar search criteria were entered in Google as if they were entered in the site.
Sounds Good! I thought all dynamic output and database content was invisible to spiders.
I was thinking I could do every kind of category search on my site and save each page as a static HTML page, but it's heaps of time and there must be a better php way! Also I am not sure if they would be spidered at all as they wouldn't be obviously linked to.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Web Crawlers And Dynamic Content
This must be a very old and well studied question... I created a site using JSP, that permits the viewing of articles that are fully stored in a database. The url for the articles is something like: .../article.jsp?idi=6&ida=12 My question is, and this is the same for all dynamic content technologies (server-side scripting technologies): is there a way to permit for search engines and crawlers (Google, Yahoo...) to find and categorize these article pages?
Splitting Results Using Select Tag
when i can make a choice out of let say 10 in a form: <select name=choice> <option value=1>1 .... <option value=10>10 </select> when i submit it will split up de results after the first loop but when i choose "next results" it does not see the value anymore and returns nothing, so how can i solve this?
Splitting Select Results Into Pages In PHP
I'm new to PHP and Mysql, so I was hoping someone more experienced could help me with this one. I've gone through most of Kevin Yanks excellent tutorial on Databases, but I haven't found an answer to my question. I'd like to split the text results of a select command into a number of pages. I'd like to display 10 jokes on one page, and then ten jokes on the next and so on. Anybody have any ideas on how to do this? I've been searching the web for most of the morning, but haven't really found the answer I needed and I was hoping somebody could give me a hand.
Arrays, Query Results And Select Box
I want/need to pre-select a drop-down box with a value if it's present in both a lookup table and user account table. After wrestling with this for a few hours I give up. i know this can't be this complicated, but apparently i'm missing something, so if anyone can suggest a way to go about this i'd be a little more sane. The idea is to have the user value already selected then when they change the value i'll update their account.
How Do I Return 10 Results Per Page Using SELECT Statement?
I'm wasn't sure whether to post this under the PHP or under the MySQL section of the forums. Since most people (I'm assuming) who write PHP script, also use MySQL, I thought I'd stick with PHP. I'm rather new to both PHP and MySQL and I'd be very grateful to anyone who can help me solve a problem I'm having at the moment. First, I'll give you an introduction to my little project... I'm developing a database in MySQL that is used to store the song titles of all the MP3s I have on my PC. I've written a basic search feature that works well. The user has 2 options: Either he can type a special "!ALL" "parameter", that I made up, to return all the songs in the database or the user may enter a few characters in the textbox and select "song title" or "artist" etc. from a dropdown to search for a specific song title or artist etc.. Hope you are following so far? Say for example the user presses submit after typing "!ALL" to return all the song titles - there could be hundreds of results. What I want to do now is display 10 results on a page, then on the next page another 10, etc. (like a real search engine!). I've tried doing it with the LIMIT statement, but like I said I'm new to this and discovered that that is not the right way of going about it. My question is this: how would I go about returning 10 matches per page? Do I use hidden form fields? What would the SELECT statement look like? What would the PHP scripting look like to setup the "back" and "forward" navigation between the result for the search?
Select And Display Multiple Queries / Results
Howdy all, i've been looking through various sites / tutorials and through this php book I have here to try figure out whats causing this problem but haven't had any luck yet. The problem is that its displaying the Designation as the link url instead of the jcode. Hope i explained this well. Above this bit of code has calls the individual Catagorys, if theres data in that catagory it will display it with whats below. PHP Code:
Taking SELECT Results And Turning Them Into An Array()
Does anyone know how take a mysql select statement and have the results placed into an array? I am returning 1+ rows and want to place those rows into an array so I can run a foreach() for each row and then run another foreach() for each column for each row? Code:
Displaying SELECT Results In A Formatted Table
I was wondering how to show a table with a max limit of 20 results per page. I have various data being pulled and its putting it in a table, but its displayed all in one row. I want to format it so its a 4 column/5 row table. With that I then want the page to generate a numbered list at the bottom that calculates how many pages it takes to show 20 items on each. Code:
SELECT Statement Results Into Text File
I am trying to create a text file based off the results of a query statement from a database. See code below: $itemq = "SELECT sdlitm, sddsc1, sduorg, sdlnid, sduncs FROM F4211 WHERE sddoco = $ordernum AND sddcto LIKE '$ordertype' ORDER BY sdlnid"; $result3 = odbc_exec($connect, $itemq); while (odbc_fetch_row($result3)){ $partnum = odbc_result($result3, 1); $desc1 = odbc_result($result3, 2); $qty = odbc_result($result3, 3)/100; $position = odbc_result($result3, 4); $uncs = odbc_result($result3, 5); $extcost = $uncs*$qty; $total = ($total + ($uncs * $qty)); $filename = "$reportnumber.txt"; $fp = fopen($filename, "w"); fwrite($fp, "Activity Number: $reportnumber "); fwrite($fp, "Warranty Type: $reason "); fwrite($fp, "Customer Name: $custname "); fwrite($fp, "$qty $partnum $desc1 "); fclose($fp); Everything works fine until I get to the line: fwrite($fp, "$qty $partnum $desc1 "); This line should actually print multiple lines into the text file as these are the line items from an order. There could be anywhere from 1 to 20 lines written to the text file. As it stands, the only line items written to the text file are those of the last line found on the order. The entrie script dealing with the text file are still within the confines of the while statement curly braces. How do I write these lines out in the text file??
Paginating Random Select Query Results
I am just starting with PHP/MySQL and using Dreamweaver MX 2004. I am selecting a subset of records from a table, then ordering them using RAND() and then displaying 6 at a time on a page. So far so good but there is one major problem, namely, when you move from page to page viewing the results the query is rerun for each page which means that you end up duplicating results. What I want to be able to do is run the query once and then page through the returned results without duplication. Also to be able to go back & forth between pages and see the same set of results. Here's a simplified example: Suppose I have 12 records (call them A - L). The query : SELECT * FROM Table WHERE Criteria = 1 ORDER BY RAND() Which returns: D F K A L F J H G C B I So my pages should show the following: Page 1: D F K A L F Page 2: J H G C B I And I should be able to switch back and forth between these pages and always see exactly the same records each time. However what I see at the moment is: Page 1: D F K A L F Page 2: F B C A E D (Note duplicates from Page 1 because query has been re-run) Page 1: C B F A K L (Note duplicates again plus results not the same as previous visit to Page 1)
Displaying Select Information From XML Search Results
I am new to both php and xml. I have a school assignment to update an existing php-based website where I have to display search results from an online library. I can use a url search which returns an XML file that includes tags such as position, title, url, description, date, etc. I only want to display the title, url (preferably the title should be a link to the url), and description for all of the results on my website's search results (different template as well). What classes/functions are available to help me do this? I would appreciate any guidance as well as links to online tutorials etc. that would point me in the right direction. I have read about the general aspects of php, and I have experience with Java and C; but I don't know about xml at all. By the way, the website is running on the school server and has php version 4. I don't think I'll be able to install php 5 but I can probably upload some helper files or something.
Why Library Is Visible?
I have composed php file with included library: <?php include("dblib.inc"); ........ ........ ?> And then if I open this php file with browser I see contents of librari. Do you know what can it be?
Causes For $_SESSION To Be Only Visible To Current Page?
I am working with PHP 4.3.8, Linux, and Apache 1.3.31 on a third-level or sub domain. The following code will diplay foo, session_id(), and increment count over refreshes: <?php session_start(); $_SESSION['foo'] = 'bar' $_SESSION['count']++; print_r($_SESSION); echo session_id(); ?> <a href="/test2.php">Next Page</a> But using the link to go to test2.php shows $_SESSION as undefined, not even an empty array. <?php print_r($_SESSION); echo 'Foo is registered? ' . session_is_registered('foo'); echo session_id(); ?>
Excel COM Application Object Not Visible
I'm trying to export an html table to an excel sheet wiht php. I know how to do this. Basically I 'm creating an .html file that includes the table with the html tags. Then I'll use COM for open this file with excel , then save it with a .xls extention. All this things works, the .xls file is created, but the excel interface remains invisible. I did use $excel->Visible=1. Why I can't see the interface?
How To Limit Visible Pagination Numbers?
how can you paginate and hide pagination numbers; like only display the first 5 numbers (similar to the pagination on the forum). then when they click on number 5; when the pagination goes to 6; they will get numbers 6 threw 10. how is this done?
Q: Extract Only Text Lines Visible In Webbrowser?
I need to web query for further processing, f.ex http://moneycentral.msn.com/investo...YMBOL=F,MSFT,DE I use <?php $MSN="http://moneycentral.msn.com/investor/external/excel/quotes.asp?SYMBOL="; $QSymbols="F,MSFT,DE"; $QStr="$MSN"."$QSymbols"; $lines = file ($QStr); ?> However, the relevant information is only 3 lines on the webpage, but more than 1000 lines in $lines, so it is slow and tedious to work with. Is there any way to extract only the lines visible in the browser?
Multiple Select From Listbox And Execute A Sql Query Select Statement
Supposing i have a html form with 2 listbox and i name it status and resolution. So it goes <select name='status[]'>... <select name='resolution[]'> Then i have a another php page. $status = $_POST['status']; $resolution = $_POST['resolution']; Now my question is, how do i do the sql query statement? mysql_query("SELECT * from bugs where status=$status and resolution=$resolution"); The problem is, i select 3 options form the status listbox eg. new, closed, duplicate. And from the resolution, i chose fixed, invalid.
Search Brings Back Different Results Or Sometimes No Results
The problem Iv got is that when searching the site - it brings back different results or sometimes no results. For example: "i026", "i 026" and "026" do not bring back results for "I-026" which is the correct model number. Any ideas on how to make it search more variations or of a "Did you mean... I-026" script?
Select Statement - Select Random ID #
I have made up a page that pull info on 13 branches of stores onto one main page. It's basically there to display all the branches on one page... then you click on the one you're interested in and then you go to a more detailed page. Back to the main page. On the top, there's kind of a featured branch that has a bigger picture and bigger title but it's still getting pul pulled from the same table etc etc etc. In order for me to avoid favortism to one branch (and for other branches to start complaining) I want to ramdomized the order every time someone came to page but I have no idea how. right now I have a super simple select statement.
Search Results ($num_rows) Does Not Match $search Results (PHP,MySQL)?
For example, when I do a database search for a term I get 2 results but the $num_rows says there are 3 results. I suspect it's because there are similar keywords within different search fields of the SQL statement. But I am stumped as to how I can change this. Any Suggestions? the code:
SELECT *
If I have a lot of articles, all with a unique IDs. First I would like to search for that ID, I could do SELECT * from ARTICLE where ID = xx But I also want to display the 5 articles before and after that article. SELECT * from ARTICLE where ID > xx LIMIT 0, 10 and SELECT * from ARTICLE where ID < xx LIMIT 0, 10 (I choose a limit of 10 in case the ID is one of the first one or one of the last one, that way I will always have at least 10 articles). Is it possible to do the above in one single query? Should I even bother doing that? does it make the whole operation faster to do it that way?
Select Box
I have a problem that I'm not quite sure what algorithm will help me on. I'm bringing in records from MySQL using PHP and need to spit this records into a select box. Fairly simple, here's my code for the first select box: <option selected value="<?=$currentCatID?>"><?=$currentCategoryName?><option> <?php while($rowGetCat = mysql_fetch_array($resultGetCat)){ if($rowGetCat['pCatID'] != $currentCatID){ echo "<option value="".$rowGetCat['pCatID']."">".$rowGetCat['pCatName']."</option>"; } } ?> </select> Problem is - based on their choice with the first select box, I need to query the DB and populate a second select box. So basically, I need a 2nd select box that is populated on the fly based on their choice from the first select box. The only solutions I have found so far use their own form, and the form I have now has numerous other options and values that I need to save the state of for editing. I was thinking AJAX might help, or maybe just regular javascript, but without having the entire page reload I'm not sure.
Sub Select
I have this line of code: $result = mysql_query("SELECT jobnumber, projectname, description FROM timesheets WHERE description IN(SELECT distinct jobnumber, projectname FROM timesheets)",$db); But this returns nothing. What I want it to do is display the 3 fields jobnumber, projectname and description where the jobnumber,projectname combination is unique.
Select The Id And The Name
I have this code that when the user provide his email address he will participate in a raffle, my problem is that i want to select the id and the name but my selection is not workin Code:
Select From
Is there a way to select from multiple mysql tabels?
Value To Use To Select All
I have done the following query: $query = sprintf ("SELECT * FROM users WHERE country LIKE '$selCountry'"); $result = mysql_query($query,$link); I want to obtain the users that are from a certain country but when $selCountry is equal to "All" I want to obtain all of them. I have tried the query in mysql webpage using '%' and it works but when using this character from the php file it doesn't work.
SELECT *
What would I have to put within the $sort variable to have that request display all rows starting with a number? right now I have to put 1,2,3,4,5,6,7,8,9 seperate. Anyway I can include it all in one variable that would work below? $q = 'SELECT * ' . ' FROM `company_details` ' . ' WHERE `cname` LIKE '' . $sort . '%'' . ' ORDER BY `cname` ASC'; $r = mysql_query($q);
SELECT MAX()
$f1 = mysql_query("SELECT MAX(id) FROM topics WHERE fid = '$f'"); $f2 = $f1+1; now, I can't see any errors...but when I ran my code $f2 should have equalled 4, but somehow it came out with 12? what's wrong with it??
Select Box
I have a select box coded that displays MySQL data as options in the pull down menu. What I need to know is if and how I can make it so that each option has given background. Can I assign a class to each option? The code for my select box looks like this: Code:
<select>
I have a query regarding <select> name: The script runs through a for loop for each select which gets the qty's from the DB, so the user can only select the maximum thats available in stock. Each select is given a name, which is the record ID from the DB ($wsi_id_arr[$num]). So the first select will be <select name="VB001"> for example. However, the problem i am having is how do I get at this in another script, for example, so far I have: for($ordercnt=0;$ordercnt<$num;$ordercnt++) { if(...................
How To Add A <br> After 3 Results?
I am wondering if anyone could help me solve this issue. I am using a foreach loop and i would like to add a line break after three records then repeat the process. Example: foreach($array as $v){ echo $v.' ';} In that example, it will display ( apples oranges banana pumpkin turnips pineapple beer pepsi) How do i get it to display: apples oranges banana pumpkin turnips pineapple beer pepsi etc.... Notice above that after each three results the next three are placed on a new line. How can I accomplish that with my loop.
Getting Results Twice?
I am having a small problem. I have a small script which gets a METAR feed, processes it and then displays the weather information. The problem is that it will accept 1 weather station as an input variable. How can I run this script TWICE within the same execution, while getting 2 results, using 2 different weather stations? The main file uses this to execute the functions which are on another separate file: Code:
Cannot Pass @ For A SELECT... WHERE
From a cycling database, to put to screen the Clubs whose Secretary has email, this works just fine in phpMyAdmin - select email from clubs where email like "%@%" order by club I want to do it in php but from the manual and these DevShed files, it seems the @ character stops all further progress along the line it's on???? I've tried all kinds'v variations of the following, brackets on and off, double and single quotes, till I'm blue in the face.
Help With Select Count In PHP
I'm trying to do a script that tells me how many orders I got in on a particular day. The script loads, but nothing shows up. Any help would be greatly appreciated! Here it is: <? //create connection $connection = mysql_connect (localhost, xxxxxx, xxxx) or die ("Couldn't connect to server."); // select database // substitute your own database name $db = mysql_select_db (MyDB, $connection) or die ("Couldn't select database."); $date = "02/05/02"; // create SQL statement $sql = "SELECT COUNT(*) FROM CUSTOMER as mycount WHERE CREATED='$date' AND STATUS=Ɔ'"; // execute SQL query and get result $sql_result = mysql_query($sql,$connection) or die ("Couldn't execute query."); //start results formatting echo "<br><br><div align=center>"; echo "<table cellpadding=5 cellspacing=0 width=ྛ%'>"; echo "<tr bgcolor='#336699'> <td width=100% valign=top><font face='verdana,arial,helvetica' size='-2' color='#ffffff'><b>Orders Today:</b></font></td> </tr>"; // format results by row while ($row = mysql_fetch_array($sql_result)) { $mycount = $row["mycount"]; echo "<tr> <td width=100% valign=top><font face='verdana,arial,helvetica' size='-2' color='#000000'>$mycount</font></td> </tr>"; } echo "</table>"; echo "</div>"; /free resources and close connection mysql_free_result($sql_result); mysql_close($connection); ?>
Select The First Letter
I'm trying to do a query, but i want the query to be done using only the first letter of the values in lname. ("SELECT * from wisdom where lname == '$letter' "); "Letter" is the value that i want generated coming from the previous page. I want all the data from lname with A as the first letter selected so i can display them.
MySQL Select
Just a qucik question. I need to display everything from the table where the data is not null, apart from username, as they'll always have a username. So far I just have this, which is on the assumption they have entered their name. $get = "SELECT * from profiles WHERE name IS NOT NULL LIMIT 30"; Is there a way I can basically make it say. Select * from profiles where * but username is NOT NULL?
Select Value In A Table
In my sql table I've a list of colors: white, blue, green..... table colors: idcolor, coloname 1, white 2, blue 3, green..... I've some programs sending colors for some material, but I don't want to use them, I'd like to use my values: example: program gives 'dark blue' then I'd like to select blue in my table and...
Select Data From Db?
I have a db that I need to select data out of. In the field it is selecting out of there is data input there from an array and then implode is used to seperate each item with a, When I run a query and wanna select data from this row I need the data from the previous form to = only one of the items in the row, but could be any of the items. how do I tell the page or the query that it could be any of many things in the row, but only has to be equal to one of them?
Using RAND() To Do A Select
having problems using the RAND() function in my mysql queries from php and can't figure out whats going on. "SELECT id FROM work WHERE active = 'yes' ORDER BY RAND() LIMIT 1" bascially it always seems to be picking the first entry from the database we'll say 8 times out of 10 out of a possible 20 results which does'nt seem very random to me?? is RAND() truely random? or are my page headers which are making sure the page does'nt cache interfering with this? //header makes sure it refreshes header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header ("Cache-Control: no-cache, must-revalidate"); header ("Pragma: no-cache");
Html Select W/php
I am just trying to have and html select and pass the $post to php page. This is what happens: html snippet: <form method="POST" action="./phphandler.php"> <select name="thisname" id="thisname"> <option value="thisvalue1">thisvalue1</option> <option value="thisvalue2">thisvalue2</option> </select> </form> php snippet: <?php $thisvar=$_POST['thisname']; print "$thisvar";?> Result: thisvalue1thisname=thisvalue1
Select Box Question
I have a database table with abut 200 entries. On a page, you can select one of these entries via a select box. I use a while loop to populate the select options, the variables look like this...$last_name, $first_name- In the select box before any of the names, all you can see is the comma. Then you see all the names: Margo, Jenny etc. Is this how it should be? Is there anyway to put 'Select Person' in place of the comma? There are no empty rows in the table so that's why I'm a bit confused.
SELECT INTO OUTFILE
I am having trouble with this function, it is designed to dump some information into text file before a record is deleted. Code:
Select Options
I am trying to pass some 'on the fly' list contents to a php handler script. The lists are created using JScript and I want to know how to get the value of the contents (not just the selected ones, but ALL the contents).
PDO::prepare And SELECT WHERE LIKE
I'm trying to get the following code to work: $sql = 'SELECT name FROM ' . DB_TABLE_CITY . ' WHERE country_id = :countryId AND name LIKE ":city%" LIMIT 10' $sth = $dbh->prepare( $sql ); etc...
Select Problem
I am building an administration page and am currently designing the edit articles page. I have different input boxes and textarea's here and there for the different things, such as title, main and intro. But i have a problem now, i want to use a <select> tag to select an array of users that i have in a MySQL database, and when i go to edit the record, i want it to automatically select the <option> that the record corresponds to. Code:
|