Getting Current Page Info Into The Query String
I have a drop down list in a form, in a PHP page, the form is displayed via 'echo'.
The FORM ACTION tags looks like this:
echo "<CENTER><FORM NAME='choose_lib' METHOD='post' ACTION='viewpix.php?ctPos=360&ctWid=109&hsp=1&loc= XXX '>";
When the user selects a name from the drop down list, which is dynamic, how can I get that variable into that ACTION url where it currently says XXX ? All I can think of is that I am going to need an intermediate page, and that doesn't sound very efficient.
View Complete Forum Thread with Replies
Related Forum Messages:
Keeping Current Query String
I send a query string to a page where what I want to do is allow the user to sort the data based on what they want from a drop down menu. Here is what I have so far and its not working. PHP Code: <form name="form1" method="get" action="results.php<?php if (isset($_SERVER['QUERY_STRING'])) { echo "?".$_SERVER['QUERY_STRING']; } ?>"> Â Â Â Â Â Â Â Â Â Â Â Â <div align=center><span class=style12>Sort by</span> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <select name=select> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <option>name</option> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <option>family</option> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <option>level</option> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â </select> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <input type=submit name=Submit value=Sort /> Â Â Â Â Â Â Â Â Â Â Â Â Â Â </div> Â Â Â Â Â Â Â Â Â Â </form> how to get it working? Or other ways to do this...?
View Replies !
Display The Current Days Tide Info
I have this so far trying to only display the current days tide info so I can output it. What am I doing wrong. Look at the xml file and I want only the current ays "Events" PHP Code: $url = 'http://tides.obinet.net' $xml = simplexml_load_file($url); echo '<b>Tide Data </b><br />' echo $xml->Date, '<br />' echo $xml->Activity, '<br />' echo $xml->Time, ' <br />' echo $xml->Height, ' <br />'
View Replies !
Page Still Caches Even With Header() And Random Query String - HELP
I created a page that will be doing image resizing and manipulation, which seems to work (using GD library). However, upon returning to the page where the image has been changed, I still see the old image, until I refresh my browser and then zappo, there it is! All changed! I have done everything I can think of to force caching including this: Code: ( php )
View Replies !
Reloading The Page With Updated Query String Values
I'm trying to build a small portfolio and instead of using several HTML pages I wanted to just use PHP. What I have is an array of each image's path (for the "src" attribute). I was thinking when I click "Next" (a text link) it increments the array and once it has reloaded itself it would simply look at the query string then display the new image. I have some questions though: 1. What line do I use which will reload the page with the new incremented variables? 2. When the page reloads itself, will it automatically get the new image to load? I already placed $thisimage = $_GET['imagenumber'] at the very top so it updates the "src" attribute for the image.
View Replies !
Pagination :: 5 Page Numbers On Both Sides Of The Current Page
I want to put a pagination on bottom of the page and I have like 100 page numbers or more, so I want to show only 5 page numbers on both sides of the current page, if u know what i mean like: Prev .. 8 9 10 11 12 13 14 15 16 17 .. Next when i move to the right or left then i add or subtract one. Here 's what i have so far: for ($i = 1; $i <= $numPages; $i++) { echo " "; if ($i == $pageNum) echo "$i"; else echo "<a href="?page=$i">$i</a>"; }
View Replies !
How To Read The Current Query (URL)
I try to create a dynamic webpage as dynamic as possible. Now I want to create a script which manage a content navigation. My problem is: How do read the current URL query. For example: The current open file is: http://www.xyz.com/test.php Now I want to create an variable which contents "test.php" I know, there are several methods with the file functions to read a path .... but how do I get the complete URL out of the query into a variable?
View Replies !
Sessions And Redirects - Send Info From Page One To Page Two.
I have a two part form, each part on a seperate page. I want to send info from page one to page two. Thought ok, I use session variables. The problem is that they don't get sent to the second page. All works fine on my local testing server, but when I go live session varables don't show. Has this something to do with header? Is there another way to get to the second page? Code:
View Replies !
Email Me This Info Page From A Order Confirmation Page?
How do i make a "email me this info" page from a order confirmation page? Basically someone enters some info in a form, then on submission is comes to my email. After submission, i want to have a text area where they can enter an email address to have the info emailed to them if they wish. You can see the page here, you have to enter info first, the email nbox on the second page (process.php) is non fuctional.
View Replies !
Query That Excludes Current Item
I have a page that displays a product to add to cart. I want to display similar products in a list below the main product based on things like brand. So I am creating a function to grab the items from my db. the Problem is that I will end up showing the currently displayed Product in my sql query. Is there a way to exclude the current Id from the return list?
View Replies !
Sql Query For Count Records Of Current Week
I have a registration form that saves the registration date on a datetime column. I would like make a query to know how many records are in the table that where for the current week. For example, I'm on week 25 and I want to know how many records I have for this week without the need of specifying the from and to dates. Is there a way to do this?
View Replies !
Refferring Page And Current Page?
I can't find a var that contains the referring page (I've looked on PHP.net and in several books)...there is one in ASP, so I am assuming there is one in PHP, too. And, I would like to test for the current page so that I can modify my menu and footer depending on the currently loaded page...is there a var that reveals this?
View Replies !
How Can I Get URL Of Current Page
I went through and searched the PHP manual, and didnt find what i was looking for. I am a PHP newby obviously. On to my question, I was just curious, is there a php variable that calls on the URL currently in the address bar? I am writing a php script to redirect a user, depending on what domain the page was accessed from. Any assistence would be GREATLY appreciated!
View Replies !
Getting And Using Current Page URL
could some1 please help me withg etting and using the current page url. I have a function that gets the url, I want to use it with header(location : XXX) but it wont work. The code is as follows: Code:
View Replies !
Current Page
HTML Code: <tr align="left"> <td><a class="mainlevel" href="population_common.php" <?php if($_SERVER['PHP_SELF'] == "/zeus/population_common.php") echo ' id="active_menu"' ?>>Population</a></td> </tr> PHP Code: elseif($_SERVER['PHP_SELF'] == "/zeus/population_elite.php")
View Replies !
Moving Info From Array To String
I'm trying to create a php file that I can use with cron to transfer a file from an ftp server to my site every day. It is a real estate site and the file contains information from the local MultiList Service. My difficulty is that the filename changes daily, thankfully within a set of parameters. The beginning letters "MF" and the ending letters "RESN001.zip" are constant, the middle of the filename changes by date and time. The time element is not standard, varying daily. Here is what I've been able to do so far: Code:
View Replies !
Emailing The Current Page
I now have a client who wants the facility for visitors to email a page to friends. He doesn't want the link emailing, he wants the page emailing "because people prefer that" - well, certainly not the people I know, but he is paying... And I don't see the sense in this, because he could end up sending code out that can't be interpreted by the mail client. As I don't use HTML email, can I ask - is there a way to get the page to show automatically via a link, without the client clicking on it?
View Replies !
Page Doesn't Refresh To Current One
I have a comment/feedback section to my website. After a person enters their comment and submits it I was hoping to have it refresh the page with the current page and their comments now displayed, but it is redirecting me to another page that I include. Code:
View Replies !
Current Page Is Secure
What's the code for if current page is secure. I can do it in JavaScript but I'm not that good at PHP. Here's the JavaScript var current_page = location.href; var current_page_is_secure = (current_page.indexOf("https://")>-1) ? true: false; I assume it's similar in PHP.
View Replies !
Remembering Current Page
I have a page entitled: show_abstract.php?Abstract_ID=1 which has a link to show_author.php?Author_ID=5 Now if user follows the link, he is redirected to show_author.php?Author_ID=5. If he updates the page by pressing the 'update' or 'cancel' button, I want him to be redirected to the page entitled: show_abstract.php?Abstract_ID=1 Now, how should I handle this, with a $_SESSION variable storing the current page link? or is there another smarter way of doing this?
View Replies !
Displaying The Current URL / Page
To insert the full URL of a current page (this is for a shopping cart "return URL"), I was using this: <? echo "$SERVER_NAME$PHP_SELF" ?> This worked fine on my old hosting server (PHP Version 4.1.2). Then I changed my hosting server (PHP Version 4.3.11) and suddenly it wouldn't work. But now I find this works: <? echo 'http://www.'.$HTTP_SERVER_VARS["SERVER_NAME"].$PHP_SELF.$_SERVER['REQUEST_URI']; ?> As a PHP newbie I suspect both are suspect.. Is there a way of doing this that I should get into the habit of using?
View Replies !
Refresh In Current Page
How to force a refresh in current page? Appreciate it if someone can show me the code. Reason: I have a page that allows user to change an image file. The image file is updated in the file directory. However, the 'old' image still shows in the current browser. The image will be updated only when I do a 'refresh' on the page.
View Replies !
Posting To The Current Page
Is it possible to post a value to the current page and display it when the page reloads?. For example if I am on 'page1.php' and usign a form to post a variable to 'page1.php', would this be possible. Possible code below: Any other suggestions if this wouldn't work? This is code for page1. php <?php echo $_POST['selection']; ?> <form action="page1.php" method="post"> <select size=1 name="selection" onchange="this.form.submit();"> <option value="goalkeeper">Goalkeeper</option> </select> </form>
View Replies !
Retrieving Info From A Whois Query
Can some one give me a little step by step to put me onthe right way.. I'd like to use PHP with Postresql. I need to make many whois query on the domain names that we own, to store the information such as expiration date and so in our DB. I was thinking of : using php to open the url of the query, retrieve the new web page with ftp mode, parsing the page with some "expression régulieres" and then uploading the found data in my DB... Can you tell me what you think of that, is there any way to be quicker and easier, and maybe some advice on how to retrieve and parse the file.. because I dont really know how to..
View Replies !
Sending Query Info To Mapquest
Does anyone know if it's posible to send a query string to a mapquest driving directions page and have it obtain a result? Also, does anyone know a good php distance calculator?
View Replies !
Getting Info From Two Mysql Tables With One Query
I think the code is fairly self explanatory, so i'll post that first. $query = "SELECT id,description,Title,tutorialtext,category," . Â Â Â Â Â Â Â Â Â "DATE_FORMAT(timeadded, '%Y-%m-%d') as date " . Â Â Â Â Â Â Â Â Â "FROM tutorial ORDER BY timeadded DESC LIMIT $max_items"; $query2 = "SELECT Name, catid," . Â Â "From tutorial_cats" Â Â $result = mysql_query ($query); Â Â while ($row = mysql_fetch_assoc ($result))Im probably missing something simple, but how do I combine query and query2 togther so that it gets both the things from tutorial, and from tutorial_cats?
View Replies !
Query Not Displaying Proper Info
I display a list of items on one page, and when they are clicked on, the user is taken to a more detailed page. Only, it's not getting the proper information to correspond with the 'id' used. Here's a link to the list page...when you click on an image or the 'model', you can see the proper 'id' is being displayed in the address bar, but not the info in the body. Code:
View Replies !
Query Pulling Info From Another Table?
I have tried to search the forums for any info and many websites on a tutorial on this topic but I cant seem to find anything. I am usually the type that will search until I find but I have finally given up. This is my very first use of PHP and MySQL interaction and I am pretty sure it isnt the BEST way to start - Below is the code I am working with now. (seems like nothing much, just basic, but it took me quite some time of searching/tutorial viewing) Code:
View Replies !
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(); ?>
View Replies !
Create Images From Within Current Page
I did a few searches but came up empty on this subject, although I may be blind. I know how to create an image and all that jazz ... but am having trouble figuring out how to generate the image on the fly (from inside a curent page) without it spitting out crap characters at me. I know you need to use the header content type of image/png - but that makes my whole page just an output of the image, as expected. Code:
View Replies !
Current Page Pagination Link
When you use pagination, how do you disable the link for the current page you are on?Example: <a >1</a> | <a href="pagination.php?pg=2>2</a> | <a href="pagination.php?pg=3>3</a> I think you would use some type of php_self code to do this, but I am not sure.
View Replies !
Login Refreshes Current Page
Currently, when a user logs into my site, they are directed to a specific page upon success. Now that I have added some depth to my site, I want users to be able to login from any page, and when the login program executes, they are brought back to same page they were at, but in a logged in state. Code:
View Replies !
Query User Info From A Session Variable
When a user logs in, a session variable is passed. The variable is the users ID. If the variable is passed successfully, they are logged in and I want to query the users information based on the session variable. Code:
View Replies !
Select Distinct And Nondistinct Info In The Same Query.
I have a database, and I want to select all elements, but I only want some to be distinct. PHP Code: $SQL = "SELECT DISTINCT TITLE, ALBUM, ARTIST, DATE FROM ". DB_PLAYING ." WHERE `USERID`='{$USER["ID"]}' ORDER BY `DATE` DESC LIMIT $start_page, $shown_rows"; I want the title, album, and artist to all be distinct, but not the date/timestamp and I'm not sure how to do what I want in one query. I still need the date info retrieved however. Basically I need to select distinct and nondistinct info in the same query.
View Replies !
Very Strange ... Reloading Doesn't Get Current Version Of Page
Very frustrated by a quirk in a normal html form submission (a search box). First it was getting no $_POST vars, though I checked the form method, and used print_r($_POST) to see. Eventually I realized that when I refreshed the browser it would not really refresh. For example I put in a phpinfo() call just to make sure I was editing the right search.php -- I refreshed and got the good old phpinfo. then I commented that line out. I refreshed and got the good old phpinfo anyway. I deleted the line entirely and still get it. So it's getting a cached version from somewhere... I can't imagine where; I've been building sites on this box for over a year and this is the first time I've seen anything like this.
View Replies !
How To Pass Current POST Data To Next Page ?
I got 2 php pages, called A.php and B.php. A.php will display all the selected records to the user and ask for confirmation before any attempt to delete. Let say the user click on the submit button, the action of the form is pointed to B.php. So my problem is, how can I pass all the current POST data in A.php to B.php as well ? I need that cauz the POST data in A.php contains the data needed like ID, to perform the deletion. I can manually write a VBScript to transfer the existing data into a query string and transfer it to the next page. However, it's not a POST data in nature. It wil become GET data right ? So what should I do ?
View Replies !
Preg_Match Source Code On Current Page
The problem is that if I set the variable $page_check to a file on our server to test it, every thing works as it should. But then when I place the script in a template file where the $page_check variable is set to $phpself - when loading a page with the script on I get firefox giving me a download box to download the current page file. So I figure I cant request a page to fopen a url which is the same url the script is on? So my question is how do I set up this script so it looks at its own source code, does a preg_match to find out what section its in? Code:
View Replies !
Random Link Form Current Page
I have huge page of links, to whcih I am currently adding. I would like to add a "random link" button which would parse the current page, extract all URLs then load a random link.
View Replies !
Download Protect Script Getting Contents Of Current Page
I'm half way through a custom built download protection script that does various things. However this is the bit that isn't working.... $name = 'file.txt' $fulldownload = '/files/'.$name; header('Content-Disposition: attachment; filename="'.$fulldownload.'"'); header('Cache-control: private'); Instead of linking straight to the file in questions it actually prints the current page (HTML) and puts it in the txt file to download.
View Replies !
Show The Current Time At The Resort On His Home Page.
I have a client who owns a resort in the Philippines. This client wants to show the current time at the resort on his home page. How would this be done with PHP? Is it some calculation based upon GMT? I think (I'll have to check) that the Philippines is +8 GMT...so is that what you'd have to do: create a snippet that grabs the current GMT and add "8" to it?
View Replies !
Upload & Query MySQL Info Database With Image Files
I want a database I can enter information and upload a photo from a web form. Then I want to query that database for the text info with its related photo and display it (formatted) in a browser (html). Summary: 1. upload photo's and text information to database with my add article form. 2. Query the database and page the results with the text and related photo. It comes in three parts: 1. add_article.php [Text / Photo Upload Form] 2. insert_article.php [Inserts into database] 3. articles.php [View Output] Here is what I have this far:
View Replies !
Memory Size Exhausted Error - Too Much Info Back From Query - What To Do?
I changed one of my MySQL search queries to allow a situation where the user gets much more information returned. However, it has now given me the error message: Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 42 bytes) in /usr/share/pear/DB/mysql.php on line 290 OK I understand what this means (I assume) that the program is trying to allocate more memory to return my query result but it wont let it. However, I need this query to return this info, so what can I do?
View Replies !
|