Adding Page Navigation To Record Set
I have gone through the tutorial on php freaks for adding page navigation to records. I am in the middle of integrating the page navigation and have stuck on 2 areas.
1)
I have a page which displays a set of records (limited to 6 per page)
Below,is the Next and Previous navigation text bUt it is not hyperlinked!!!??
The line of code specifically is:
<?php
echo("<a href="$PHP_SELF&page=$pageprev">PREV".$limit."[/url] "); - This should be hyper-linked but is not??
I think there could be a problem with the <href bit being AFTER the <?php. I am basing this on the fact that a previous record i made began the hyper-link <href BEFORE the <?php where as before the <?php was added only after : Code:
View Complete Forum Thread with Replies
Related Forum Messages:
Record Navigation Problem
I am using Ultradev and PHP Phakt extension Need to show Search Results in Detail page from Form with 2 fields and "Post". SQL query SELECT * FROM psale WHERE name LIKE '%MMColParam%' and prewhat LIKE '%MMColParam2%' $HTTP_POST_VARS["prewhat"] Problem: Only the first detail page gives the right results. Navigating to other more results using record navigation bar is mixing up the results. Only first detail page is showing the right query results.
View Replies !
Unique Field Which Stops It Adding The Record?
When a user submits / posts data my php script Inserts data into my database. If they refresh the script or click back and click submit again I get duplicate record. Is there an easy solution to this? Or do I need to create a hidden field which contains some sort of unquie data, like a time stamp and have a have a unique field which stops it adding the record?
View Replies !
Redirect And Stop Refresh (adding Record)
I have created this file in order to allow user to input a new record, the script works fine, but after adding a record, if you click the refresh button again the record will add again, i tried adding close connection code, but not seems to be working, how can i clear my form to "" to avoid the duplicate records, also after the submision of the record how can i redirect or load a thank you page. Code:
View Replies !
MySQL INSERT Command Adding A Blank Record
I have a form that I am INSERTing into the MySQL database. I have the names and vaules set. The columns header is the same but when I "submit" the form it adds a blank record to the database. If I add another one, another blank record is added. Code:
View Replies !
Basic Php Mysql Knowledge, Setting Up, Adding Removing Record
i have an average knowledge but I have never got to a point connecting to mySQL and adding and removing a record. i have tried but have ended up getting confused... I understand SQL.. but i just don't get setting up a database and then connecting it using PHP and my mySQL is it possible someone could give me a simple explanation of how to set a mySQL database setup, login, add a record, and remove a record.. ?? im good at asp can connect to access easily and change data.. but i really want to get to grips with it using PHP and mySQL.
View Replies !
Page Navigation From Search Results
I have created a search form that searchs for results from my database matching the criteria to what ever the user inputs. I have done this using 2 php pages the first page points to the second, where the data is sanitised and cleaned accordingly. The results are displayed on the 2nd page. Code:
View Replies !
Home Link From Navigation Page
I got a code which helps me to create navigational links and only show 4 results per page. Now I want to add a link on each page such that if anyone clicks on that link it takes it to HOME page. I have added <a href="Home.htm"><b><font size="4">Home!!</font></b></a> inside the loop that generates NEXT and PREVIOUS page link but whenever I click on HOME it does nothing at all.
View Replies !
Automating Page Navigation And Control Transfer
Is there a system available to do the following: consider an app of a few pages: page1.php: form1----->page3.php form2----->page4.php page2.php: form3----->page3.php form4----->page4.php when I am at page3.php, I do not know whether I came there from page1->form1 or page2->form3. I can check for $_SERVER['HTTP_REFERER'] and get an answer. But this example is simple. Let us generailze that I want an app that keeps a track of all the pages the user requested, in the order that they were sent to him. Obviously, it can be written based on sessions. Is there already some popular open source application for this? Also, this brings me to a broader question of page navigation rules. In an app made of 20-50 pages/scripts, life will be hell if there is no systematic approach to transferring control between pages. Is there some kind of structure already made and readily available into which you just plug-in your pages by telling some rules ? E.g. the scheme is something like: $ListOfPages = array( 1=>"Main.php", 2=>"Edit.php", 3->"Add.php", .........., N->"Error.php"); $RuleSet = array( 1=>array("Main.php","Edit.php","allow_edit"), 2=>array("Main.php","Add.php","allow_add"), ................... 3=>array("Main.php","Error.php","my_error_handler") ); The RuleSet is a set of page transfer rules based on evaluation to true of the specified functions, i.e., allow_edit(), allow_add(), my_error_handler() etc. Obviously, form submission is the chief means of control transfer for PHP programs and the use of ?op=add_something in URL's(GET) and <input type=hidden name=op value=add_something> (POST) are a step towards making some kind of structure. So the grand code will look like: $MyGrandAppControllerObj = new GrandAppControllerObj(); $MyGrandAppControllerObj->setPages($ListOfPages); $MyGrandAppControllerObj->setRules($RuleSet); $MyGrandAppControllerObj->Run();
View Replies !
Page Numbering - Change My Navigation Menu
i am busy with a image gallery and i have it working. but now i want to change my navigation menu this one: [1] [2] [3] [4] to: <<first [1] [2] [3] [4] [5] [6] last>> i have also this code, (c second code ) but i cant link it to my foto folder and unsort it from 10 to 1 ,like the newest u c first. Code:
View Replies !
Multiple Navigation Tables On One Page (master - Slave)
I just wanted to refresh only part of the page, i.e., table2 on my php page. here is my javascript code which performs the refresh it works fine and my php file display all the records. the only problem is: I have got two tables on the same page and i only want to refresh the second table when i click the a row of my first table rows. Code:
View Replies !
1 Record Per Page
I want to display one record per page but what i want to do next is. is to view another record on a new page by clicking a next button. How do i do this? I am using ID so do I have to do somthing like $ID+1 to goto the next record, and $ID-1 to go back.
View Replies !
Updating Record From Page
I have this page that displays point information for members and I want to convert it to an update page. I've made forms before but never for updating, just regular inserts and form mail. if ($submission) { UPDATE guild_chars2 SET gp = '$results[gp]' <--- parse error WHERE name = '$name' }
View Replies !
New Page For Each Record Automatically
I've already got my database & tables setup and have already began learning the basics of querying the database to create a webpage. I'm trying to create a website for archival of football stats and team history, etc. I've slowly started working on it, here's something I have so far. Here's the simple query I'm using: Code: SELECT Num, Lname, Fname, Pos, Height, Weight, School, Picture FROM tblRosters WHERE School = "Arkansas State" ORDER BY "Num"' Code:
View Replies !
Mysql Record On Page
I'm trying to link to a specific record from one page to another. Let me try to explane: I have a homepage with some of the records of the latest news table + a link to "read more". I have the news page with all of the records of the latest news table Now when I click the read more link on the homepage I want to go to that specific record on the news page. I've tried to use printf ("<a href='http://www.crivic.com/latest_news/index.php?id=$rij[id]'>(read more...)</a>");
View Replies !
Adding A GET To A Page
I'm using a page that has already a $_GET in it, and when I click submit on my form it doesn't include the original get it and just includes the new $_GET. My page name is signup.php?page_id=19. It should do this: signup.php?page_id=19?game=football. Instead it does this signup.php?game=football it leaves out the page_id bit. I'm using PHP_Self in the action of the submit button. Anyone know how to get both variables in the url?
View Replies !
Record The Date And Time When The User Enters A Page
I have a situation where I need to record the date and time when the user enters a page. And I need to store in an MySQL table later, the stored date and time (when user entered the page) and the date and time of inserting the record (meaning execution of query). However, the two dates and times are always equal. Is there anyway I can store the original entry time of the user either thru PHP or Javascript?
View Replies !
Diplay THE MOST RECENT Record In One Place On The Html Page
I need to retrieve the most recent additions to a table where column name='$string' My question is that of these records returned, I need to diplay THE MOST RECENT record in one place on the html page, and then display the others (in order from newest to oldest) in another place... I can pull the records with a select statment, and I understand the ORDER BY statement that follows, but how do I split the results as above? ** The records have a 'date/time' column, and a 'category' column that I will use to perform the select statement...**
View Replies !
Moving Through Records In Table In A Single Record Page
I'm trying to create a updates pages that I can move either to the previous record or the next record within a recordset without having to return to the repeating list of records after each up date. Assuming I have done the recordset correctly, which I have and the update records command as well here is the code I'm trying to use: Code:
View Replies !
Adding A Page - FTP Details?
I am creating some PHP files and on one of them the user has an option to add a page. I know how to create a page using PHP, but when I try to do it, it gives me a message saying I dont have permission to do this. Am I suppose to include the FTP details in order to do this? And if so, how do I insert them?
View Replies !
Adding A Further Behaviour To A Page
I've got a page where it seraches a database and returns hotel info. On the page returned it also has a behaviour that highlights whether a particular venue has been 'blacklisted'. I need to add a further behaviour that indicates whether a particular venue is commissionable or not - if not it should highlight that venue as being non-commissionable. I've tried various means of inserting the additional 'warning' but the page just crashes out. Where am I going wrong with this? Base page code below. In a nutshell I've set up the sql - written from another page so that to simple radio buttons indicate noncomm or not: Code:
View Replies !
Adding A Column To Web Page
I have a Web Page with a Form on it. How/where can I add a left hand column that will run all the way down the left side? Here is the page code, and I've attached an image of what it looks like now. Code: <?php global $account;?> <link href="../style.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <link href="../style.css" rel="stylesheet" type="text/css" /><style type="text/css"></style> <table cellpadding="0" width="770" height="100%" cellspacing="0" bgcolor="#FFFFFF" style="border-right: solid 1px #6b6b6b"> .........
View Replies !
Admin Page For Adding Categories
I'm trying to put together an online catalog (similar to shopping cart but with no pricing) I have a need for categories and then sub categories. I have discovered the hierarchial database model where the catagory table will look similar to | ID | CATEGORY | parentID | What I'm having difficulty with is trying to visualize how to do an admin page to put data into this table?
View Replies !
Adding Additonal Values From Forms To The Top Of The Action Page
I have form on multiple pages with one text input and two hidden fields. When the user submits the form, they are taken to: /actionpage.php?input=x&hidden1=y&hidden2=z On the action page there is a third party JavaScript that I can not change that requires the two hidden fields. I am wondering if I can setup something at the top of the action page that establishes the two hidden fields, allowing me to take them off from all my pages while still allowing the third party script to work.
View Replies !
Script Repeat Updates The Record And Also Inserts Another Record With The Same Information.
I have a form which contains some fields that are populated with data from a table. This same form also has fields that are empty because the data has not been collected yet. The main table is called client with a primary key of client_id. What I need to do with this form is select the client and update the record into a new table with the missing information. If the client doesn't not exist in this second table, I need to insert the row otherwise if the client does exist in this table because of a previous update, update the record. When I run my script, the insert works. When I try to run the script again and try to update the record, the script not only updates the record but also inserts another record with the same information. How can I write my script so it checks whether a client exists in a table and if it does, update the record and if the client does not exist in the table, add the client?
View Replies !
Compare Record With Session Variable And Update Record If Different
I'm trying to figure out how to create a session variable from a recordset field value in a mySQL database and compare this with subsequent values from the same field each time the page reloads. When the value of the field changes (as a result of a user update) I want to trigger an event (redirecting to another page). It's probably a very basic PHP function but I am a newbie with this language.
View Replies !
Delete Record - When The Delete Link Is Clicked The Next Page Is Blank And Nothing Is Deleted.
This is my "delete.php" and this "todo/delete.php?id=64" an example of a link to it generated from the index.php page. When the delete link is clicked the next page is blank and nothing is deleted. What have I done wrong? <? include("dbinfo.inc.php"); mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $id="delete from todo where id='$id'"; mysql_query($id); mysql_close(); ?>
View Replies !
Adding A "Privacy Agreement" Page
Right now I have it set up so that a user logs in and they are brought to a "privacy policy agreement page" the user then selects the accept button at the bottom of the page and is redirected to the correct welcome page. What I am looking for is how to make it so that a user has to check a check box, then press the accept button to be redirected to the welcome page. And if they dont select the checkbox they are redirected to my logout page.
View Replies !
Navigation Bar
how to create a navigation bar? i have a db with news and i want them to be displayed 5 each time. if you know some tutorials or scripts pls let me know.
View Replies !
Map Navigation
we are currently reprogramming the way we display our area maps and instead of chopping up each map into many smaller squares, a friend recommended i look at image magick's magick wand, which could create the chosen segment on the fly from 1 larger map. has anyone done this and could point me in right direction with a few tips?
View Replies !
Navigation
I had a script for my website for including pages via PHP, and linking other pages into it: <? if($id) { include("$id.php"); } else { include("home.php"); } ?> However, I heard this could be hacked easily (ex: www.yoursite.com/index.php?id=theirsite.com/hack.php). Is this true? Also, if this is true, is this script safer? Code:
View Replies !
Navigation Problem And PHP
Problem: I'm trying to get a navigation path/string similar to devshed or zdnet. ================================================= Example: "you are here: home / news / archives / article" With each in turn being a link and the last being the title. ================================================= I have a small file in the directory /news/archives/ that takes an include file and populates page from mySQL. A function is called (getNavPath) that looks to see where the file is and prints a navaigation structure back up the tree. A snippet of the code I've done so far: ================================================= <PRE> //passed in the doc title function getNavPath($navtitle) { $path = getenv("REQUEST_URI"); $dir=dirname($path); $dir_array=explode("/", $dir); // split the string by forward slash (directory delimiter) /* note: the array will now have an empty string as its first element because every file is at least under root ("/"). So we'll shift it by 1 to get rid of this empty string */ array_shift($dir_array); $arraylength=count($dir_array); //length of the array /* if the first element is set, i.e. we're not directly under root and can proceed*/ if(isset($dir_array[0])) { echo("<a href="/">home</a> / "); //prints home with a link back to home for($i=0;$i<$arraylength;$i++) { $dir_path.="$dir_array[$i]/"; echo("<a href="/$dir_path"."index.php">$dir_array[$i]</a> / "); } echo("$navtitle"); }//end if isset.. else { //print the title echo("$navtitle"); } }// end getNavPath </PRE> ================================================= The problem is that when I type the URL without the specific filename e.g. www.domain.com/news/archives/ it doesn't seem to work (although the index.php file is printed okay). Also if I do type in the full dir1/dir2/dir3/index.php, then dir3 will point to the current page, but I can sort this out. Can anyone help? Am I going about it the right way?
View Replies !
Using PHP In Navigation Crumb
I'm pretty new to the world of PHP and need a little assistance. I've got a static site at the moment, but I'd like to make it a little easier to maintain and update. One of the areas I think PHP will really help is with the navigation crumb. Rather than typing in all the information such as 'Home > Category > Article' ... what could I use? I'd like PHP to just insert the Home URL, followed by the category name and URL, follwed by the article title.
View Replies !
Controlling Navigation With PHP
I got a set of pages which must be navigated in a strict manner. Let's just say the pages are named A, B, C, and so on. I got no problem with forward navigation, but I want to disable the client browser's back button. More specifically, if the user is currently at page D, the back button doesn't bring the user to page C, but page A instead (assuming consecutive navigation, from A to B to C and so on). How can I achieve this with PHP, assuming both the server and the client are behind strict firewall (both referer and cookies disabled), and use of client-side javascript are avoided as much as possible (or even considered disabled as well, either by the firewall or the browser's setting)?
View Replies !
Dir Navigation With Php Ftp Functions
I'm having trouble navigating my directory structure using php's ftp functions (such as ftp_chdir and ftp_cdup.) I'm writing a program that allows a user to easily create robot.txt files and upload them to their server. They should be able to log in to their server using ftp and browse their directory structure, specifying which robots to allow into each directory. When the user logs into their server, they are presented with a list of directories displayed as links. Clicking a directories link will take them into that directory and will present them with the sub-directories contained in that directory. I have the program running at Each time is link is clicked, the page is refreshed and ftp_connect called, meaning that the user is logged back in to their root directory. I have a stack containing the directories that have been navigated, so that the program can direct the user to the drectory they intend to be in. This seems overly complicated. Is it possible to do what I am trying to do just using php's ftp functions, without storing a session variable containing all the directories that have been navigated? Is is possible to not have to re-login to the root directory every time a page that uses ftp functions is called? The solution I have seems to work well and handles symbolic links, but has the drawback that I can't navigate above the directory that the user originally logs into. It also just doesn't seem like the correct way to do this. I'm sure there is a simpler, more proper way. <?php include 'include.php' session_start(); //If $_POST variables are set then we are logging in for the first time and set $_SESSION variables accordingly if (isset($_POST['server'])) { $post = clean_post($_POST); $_SESSION['ftp_server'] = $post['server']; $_SESSION['ftp_username'] = $post['username']; $_SESSION['ftp_password'] = $post['password']; //Create a stack/array which holds the name of the directories we have traversed $_SESSION['directories'] = Array(); } //if we are not connected to a server then redirect to the login page if (!isset($_SESSION['ftp_server'])) { header("Location: login.php"); exit; } //If $_GET variables are set then we are actively navigating the directory structure if (isset($_GET['dir'])) { $get = clean_get($_GET); $ftp_dir = $get['dir']; } // set up a connection or die $conn_id = ftp_connect($_SESSION['ftp_server']) or die("Couldn't connect to " . $_SESSION['ftp_server'] . "<br>"); // try to login if (@ftp_login($conn_id, $_SESSION['ftp_username'], $_SESSION['ftp_password'])) { echo "Connected as " . $_SESSION['ftp_username'] . "@" . $_SESSION['ftp_server'] . "<br>"; $_SESSION['username'] = $_SESSION['ftp_username']; } else { echo "Couldn't connect as " . $_SESSION['ftp_username'] . "<br>"; } // turn passive mode on ftp_pasv($conn_id, true); //If we are navigating the directoty structure if (isset($ftp_dir)) { //if we are navigating to the parent directory pop the name of the current directory off the stack if($_GET['act'] == 'cdup') { array_pop($_SESSION['directories']); } //otherwise we are navigating to a child directory else { //grab the name of the current directory and push it on the $_SESSION['directories'] stack $pieces = explode("/", $ftp_dir); $relative_path_dir = array_pop($pieces); array_push($_SESSION['directories'], $relative_path_dir); } //Since the stateless nature of http forces us to always login to the root directory //we use the $_SESSION['directories'] stack/array to navigate to child directory we are trying to access foreach($_SESSION['directories'] as $rel_dir) { if (ftp_chdir($conn_id, $rel_dir)) { //do nothing for now } else { echo "Couldn't change directory "; } } //we are in the child directory, so display the path echo "Current directory is now: " . ftp_pwd($conn_id) . " "; } else { //we are in the root directory, so display the path echo "Current directory is now: " . ftp_pwd($conn_id) . " "; } function create_dir_tree() { global $conn_id; $files = ftp_nlist($conn_id, ""); //get files in directory if(is_array($files)) { //display a link to the parent directory echo "<br /><a href=index.php?&act=cdup&dir=" . ftp_pwd($conn_id) .. ">parent directory</a>"; foreach ($files as $file) { $isfile = ftp_size($conn_id, $file); if($isfile == "-1") { //Is it a directory? (as opposed to a file) //display a link to each child directory $string = "<br /><a href=index.php?&dir=" . ftp_pwd($conn_id) . "/" . $file . ">" . $file . "</a>"; //replace any double slashes with single slashes $url = preg_replace("////", "/", $string); print $url; } } } else echo "<br /><a href=index.php?&act=cdup&dir=" . ftp_pwd($conn_id) . ">parent directory</a>"; } ?> <html> <head></head> <body> <table border="1" cellSpacing="3" cellPadding="3" width="100%"> <tr> <td> <?php create_dir_tree(); ?> </td> <td> <form method="post" action="create_text.php"> <table border="1" cellSpacing="3" cellPadding="3" width="100%"> <tr> <td> <ul> <li><input type="checkbox" id="all" name="all">* (all spiders)</input></li> <li><input type="checkbox" id="googlebot" name="googlebot">googlebot</input></li> <li><input type="checkbox" id="askjeeves" name="askjeeves">askjeeves</input></li> <li><input type="checkbox" id="slurp" name="slurp">inktomi slurp</input></li> <li><input type="checkbox" id="scooter" name="scooter">altavista scooter</input></li> <input type="hidden" name="path" value="<?php echo ftp_pwd($conn_id) ?>"></input> </ul> </td> </tr> <tr> <td align="center"> <input type="submit" value="Submit"></input> <input type="hidden" name="activity" value="logging_in"></input> </td> </tr> </table> </form> </td> </tr> </table> </body> </html> <?php // close the connection ftp_close($conn_id); ?>
View Replies !
Navigation In First Application
I've writing my first php application and it's killing me. I've been programming desktop stuff since the early ྌs but this is way different; php, html, css, and (god forbid) JaveScript all interacting. I figured out the session management (I think) and can log a user in and display a <table> with links <a> for the user to select the next action. What I would like is for the href to specify a php function and pass parameters to the function. Something like this would be cool but doesn't work. <a href="do_some_stuff($menu_data[menu].pid)">{$menu_data[menu].pname1}</a> I understand that the href thing can contain a URI or href="do_some_stuff.php", but how do you create a page where the user can select an option and have it call a function based on the selection? I'm using php5, smart, & Firebird.
View Replies !
|