Get The Value You Pass From One Page As Part Of The Query String?
How do you get the value you pass from one page as part of the query string i.e
htttp://www.somesite.com/postage.pgp?newsid=2
How you you get the value of the variable in the next page, stumped.
View Complete Forum Thread with Replies
Related Forum Messages:
How To Pass Array In Query String?
i have a search function consisting of 10 check boxes in an array that when you check the boxes and press search it passes them as an array and this works fine. problem is that i have pagination on the search results page and if the results are too long it places links to the other pages and these have query strings that need to pass the search selection criteria. the search criteria is an array, how do i pass an array by a link? i cant work it out, it just wont work. when ever i click to goto page 2 of results all i get is errors as the array doesnt get passed.
View Replies !
Pass The Query String When The Single Table To Be Sorted.
How to pass the query string when the single table to be sorted. I just want to pass the query string for each column separately when clicked on the header. When I click the column header it should sort in ascending when again clicked it should sort descending... <a href="abc.php?name=asc ...........Name[/url]
View Replies !
How Do I Pass The Users Name To Another Php Page And To The Sql Query?
i have this simple project of member directory in which user enters the detainls like name address age email etc. through a html page then the details are displayed through a php page. now in this page when one clicks on a user name i have to show the details of that user only. how do i pass the users name to another php page and to the sql query?
View Replies !
Grab The ID From The DB And Pass It To Be Part Of The Renamed File
I have another file that copy a template from a folder (here for the example: footer.php to another folder within that folder where now is the new copied "footer.php" I run the following script Which results in "No such file et..." The idea behind $ID is that the new file got to be have a different name than other similar files And got to be unique so I grab the ID from the DB and pass it to be part of the renamed file Well it does not work as planned. <? $rename=$id; $file_name = footer.php; $read_extension = explode(".", $file_name); $ext = $read_extension[1]; $renamed = $rename.".".$ext; rename($file_name, $renamed); ?>
View Replies !
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 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 !
Parse Part Of String (mid String Function ?)
Can someone tell me how to parse part of a string? I can use the following: <?php $text = $_SERVER['PHP_SELF']; //$PHP_SELF //(document.url); echo $text; ?> to get this result: "Your currently at /test.php " I just want to get "test.php " without the dash. I also need to parse out parts of other strings. I know how to use Mid(), Left(), and Right() in VB, but no clue for PHP.
View Replies !
Getting Part Of A String
What I am attempting is to retrive part of a string, the string comes from TEXT field in mysql db using mysql_fetch_row. It is an article, in the article there is flags like for example [image]img=34,align=left[/image]. Now I would like to retrive the [image]img=%[/image] part to be able to use the wildcarded number for a database query to get the image link and image comment then giving it all a proper html formatting. After that, I replace [image]img=%[/image] in the original string with the newly formatted html.
View Replies !
Get Part Of A String
if I could use php and get certain parts of a string like $string: = "<table><tr><td>Name</td><td>Desithugg</td></tr></table>"; Would it be possiable to use something like preg match to get only that part Desithugg into another string like $name. So I want to get the part between <td>Name</td><td> and </td></tr>. If it's possiable can anyone give me an example. I tried looking at the manual but didn't quite get it.
View Replies !
Using Only Part Of A String
Pulling data from old DB to new DB. One field is text for an article, I need to pull it and only get part of it for a new summary field. How can I get just part, say 1 or 2 paragraphs out of the string?
View Replies !
Replacing Part Of A String
I am using the command ereg_replace() to replace " with ' . For fast web pages, I use Microsoft Frontpage and it has everything use ". I have to change them all to use ' . The code is writen and it works, sort of. It has some text displayed at the end I don't want. Here is the my code:
View Replies !
Replace Part Of String
just found a problem with part of my project if a ' is present then it screws up the sql query- so, i need toget rid of it, would the best way be to, use regex, and see if string a contains a ' || string b etc and if so, use str_replace("'","",$string);
View Replies !
Retrieve Part Of The String
If I have a string $string = "SELECT * FROM TABLE WHERE AGE > 0 ORDER BY NAME"; how would I retrieve part of the string before 'ORDER'; i want this part 'SELECT * FROM TABLE WHERE AGE > 0' if i use strstr($string,"ORDER"), this retrieves 'ORDER BY NAME' is there an opposite function of strstr()?
View Replies !
Return Part Of String
I am currently looking through the PHP manual for a way to return part of a string, e.g. $str = '(number:1)' $i = preg_return(number:[0-9]*, $str); which would echo me back a "1". strstr() would kind of have been nice, but then I would get the last parenthesis also. One way I could do this is using preg_replace and kind of remove all other strings and only return the number, but I feel that there should be a "easier" (read: better) way to do this.
View Replies !
How Can I Get The Middle Part Of A String?
If I have a string such as.... $a = "Start Middle End"; How can I extract "Middle" out of this and put it into $b? I want to do it by searching for the first space and stripping it out of $a. Then I will be left with "Middle End". Then I want to search for the first space and strip it and anything after that and be left with "Middle".
View Replies !
Trim Part Of A String
I would like to trim part of a string which looks like this: $input = "This part should stay (Bracket) (Bracket2) (Bracket3)"; $output = "This part should stay"; Second and third brackets do appear sometimes and sometimes not. I need the part before the first bracket and leave the space char out. How can I do this?
View Replies !
Stripping Off Part Of A String
I really read all about preg_replace and other pregs and strs but cant actually do this one: $path = "/var/www/help/index.php"; the path can differ, there are more or less dirs but there always is "/var/www" part and I want to strip it off and get whatever comes after that. I really cant understand these preg_replace parameters like ("/(</?)(w+)([^>]*>)/e", So could anyone help me in the above specific example ?
View Replies !
String As Part Of A Variable Name
This has been bugging me for a while now! I'm trying to figure out a way to make a string part of a variable name. I know you can do this: PHP Code: $var = 'string' $$var = 'something' echo $string; I'd like to concatenate the term 'string' with something else, such as: PHP Code: $var = 'string' $$var._test = 'something' echo $string_test;
View Replies !
Find Part Of A String
I am an ASP guy who has been converting to PHP. Anyway, I'm having a problem figuring out how to find part of a string. What I am trying to do is to list any file that starts with "info". So I've got a while loop that will show all the files, but now I'm trying to figure out how to display only the files that start with "info". In ASP it would be like this: If Left(strFileName, 4) = "info" Then Response.Write(strFileName & "<br>") End If Does PHP have a function like this? In the example above it reads the first "4" characters in the string strFileName and compairs it to "info".
View Replies !
Creating Part Of A Query
i have a string containing tables name dynamicaly like $str="tbl1,tbl2,tbl3,tbl4"; now from here i want to create a part of query like tbl1.id=tbl2.id and tbl2.id=tbl3.id and tbl3.id=tbl4.id id is fixed value so no worry about it.
View Replies !
Very Long Where Part In Sql Query
I have a mysql query which will look like select * from table_name where id=餶' or id = 餭' or id = ད' or id = 髥' there will be more than 1000 such or statments. these numbes are not in order and are pretty much random, anyway to make this faster?
View Replies !
Best Way To Encrypt Query Part Of Url
i need to be able to encrypt the query string part of the url, which I can then download from my referral logs and decrypt. It does not need to be strong encryption, just so the original string is not visible. Is my best option mycrypt? If so, is there is a way to make the encrypted string just use ASCII characters? I have been playing around a little with it and it uses all manner of crazy unicode characters.
View Replies !
Replace Part Of String In Between Two Other Parts?
I'm trying to do is an str_replace or something within only a set of other strings. What I'm doing with some text that I put into a database is added a <br> whenever the ASCI character 10 (carraige return) comes up. It's like this. $text = eregi_replace(10, "<BR>", $text); what keeps happening though, is that when I make an HTML table in the text, it adds a <br> to that too, and since it's inside the table, it just adds the newline to outside of the table or something and screws everything up. So, what I want to do is only have it replace the newline with a <br> if it isn't inside of a <table></table> string. I've been all over the PHP documentation and have yet to see something that might work.
View Replies !
RegExp That Looks For A String And Only Replaced Part Of It...
I'm after a regular expression that looks through a string for a certain code, and then replaces part of that code with some markup: So look in this string: this text contains (T123) a code. And become this string this text contains (T<a href="?a=123">T123</a>) a code. The main problem I'm having is that my regexp replaces the whole match, including the T: $pattern='(T[0-9]{3})' $replace='<a href="?a=1">1</a>' This results in a hyperlink "?a=T123" when I want ?a=123
View Replies !
Copying Variable Part Of A String
I have strings like these: $line = "Item <name> xxx stock, costs yyy and will sell for amount zzz"; Problem is <name> can consist of 1..n words. Most items are single words, but some are up to 8 in my example, and there are is no set maximum (well, max is 80 chars I believe, have to look in the stock db, not too relevant I think) I found this out the hard way. I thought I was clever (never do that again) by doing this: $words = explode (" ", $line); $itemname = $words [1]; This only works for single-word names. Now I want to create or use an existing function that simply copies everything between Item and the first numerical substr. The function then should look like: $itemname = GetSubStr ("Item" , <numerical> , $line); <numerical> should be a template of some sort I think.
View Replies !
How To Get A Part Of String Using An Iterative Method
Assuming I have the following line from a text file: define ('THIS_IS_A_TITLE', 'My data for this title'); which I load into a variable, therefore $line = define ('THIS_IS_A_TITLE', 'My data for this title') My purpose is to get two variables from that like $title = THIS_IS_A_TITLE $data = My data for this title How would you do that? I thought of counting the ' characters, then $title begins after the 1st ' and ends before the 2nd, whilst $data begins after the 3rd ' and ends before the 4th. But maybe there is a more elegant way. Any ideas?
View Replies !
Replace Part Of A String With Wildcard?
i replace everything betwwen two different characters: <font face='Verdana, Arial, Helvetica, sans-serif' color=#FFFFFF size=3> or <font face='sans-serif' color=#0f0f0f size=3> so all the font tags will change to <font size=1> could i do "[<font] .*. [>]", "<font size=1>"
View Replies !
Substr :: Extract Part Of A String
Say i wanted to extract part of a string with the substr command i need say 1.mickeymouse-home how would i extract just mickeymouse and then extract home after wards $string = 1.mickeymouse-home; substr($string1,strpos($string, "-")+1); - i thought this would get me everything after "-"
View Replies !
Storing Part Of A String In A New Variable
I have a string (usually a url as it happens) which I need to get a certain part of and then store it in a variable. i.e. my strings are like this: "http://www.foo.com/directory/add/00102020/do.php?stuff" "http://www.foo.com/directory/add/00301090/do.php?stuff" So basically the URL or String are the same except for the numbers change. It is the numbers I want to store in a new variable. I think I need to use regular expressions and preg_replace but just can't get my head around how!.
View Replies !
Mysql Or For Search (select Part Of String)
I am creating a search function and i want to select say only 100 characters (or pref. 40 words) before and after the returned phrase in the results. so far i am using: $get = mysql_query("SELECT * FROM posts WHERE content LIKE '%".quote_smart($query)."%' ORDER BY $order") or die("Cannot search: ".mysql_error()); i tried to use SELECT id, title, tid, uid, LEFT(content, 50) FROM POSTS.... but the query returned none of the content? any ideas? Code:
View Replies !
Single Quotes Round Any Part Of The Query?
When creating queries in PHP for example: $test="SELECT test FROM test WHERE testId = $testId"; Should there be single quotes round any part of the query? It works fine as it is, I just want to be sure I am writing my code to the proper standard.
View Replies !
How Would You Search For A Part Of A Word In A Whole String Or Flatfile Line.
How would you search for a part of a word in a whole string or flatfile line. for example like: the user inputs tax or another word and if the input is part of a larger word like taxation then it will print the result. Im trying to create a search that will allow the user to input small words and it will search the whole file and if a string with that file is found it will print it.
View Replies !
Page Loades Part Of The Page
the below code is kinda working but its only loading part of the page, when I do a page refresh the rest of the page loads. the part of the page that is not loading correctly is the bottom 1/2 which displays images. Code:
View Replies !
Caching A Part Of A Page?
I am working on a custom banner generator for some of our users. Its basically a flash banner that can take vars for colors etc, so users can integrate with their sites colour scheme. Its set up currently with the banner at the top as a preview, with e.g. .swf?color1=00000&color2=45efef in the object and embed tags. Below this is a script that is 3 nested for loops, that increment a var each and convert that to hexidecimal. The three hex refs are then concat'd together, and set as a CSS background to a transparent gif with an href around that calls the same page with the new colors in the url, which get passed back to the flash movie. (hope im making sense here :)) So theres about 500 or so (im incrementing the vars by two,otherwise its way sloooow) <a><img></a> that have to be generated on each page load. Im wondering how and if i can speed this up?
View Replies !
Getting Part Of Another HTML Page
I'd like some help with writing a script that grabs part of another HTML page. For example : I want to grab the content of a HTML page that contains the following strings : <!-- begin --> and <!-- end --> Then I want to get all the content (including these two tags) that is in between the two tags.
View Replies !
Refreshing Part Of A Page
Can some one help me if it is possible to refresh a part of a page, without reloading the whole page. Let's say, i want to add a small message box to my webpage. After writing a message, the user presses the send button and i want only this part of the page to refresh and give him a status message saying his message was successfully received.
View Replies !
How To Let Php Reflesh Part Of Page
I want to write some code that when some variable condition is met, it will change a table cell value (only reflesh that value instead of the whole page), I used to think it as calling JavaScript function first, which in turn change that table cell value in the page. But I don't know how to let php call JavaScript, or mimic click button action to call JavaScript.
View Replies !
Selective Rendering Of Part Of A Page
I want to skip the rendering of certain parts of a Web page if the user doesn't have a certain permission (e.g. a cookie). I'd like to do it along these lines: <p>Anybody can see this paragraph.</p> <? start_protected_section($got_permission); ?> <p>Not everybody can see this paragraph.</p> <? end_protected_section(); ?> Is it possible to disable the rendering of a section outside the code like this (perhaps by setting a PHP flag to redirect subsequent output)? I don't really want to complicate things by moving part of the page into a separate "include file" or mixing the HTML and PHP by using a here-document (the <<<END syntax).
View Replies !
Include Specific Part Of Page
i know that the include() function allows you to include a page with php but how do i only include PART of a page like specific tables? what im trying to do is get the certain parts of this page: ...
View Replies !
Need To Copy Text From One Part Of Page To Another
It has been great so far but I hit a road block on one thing and I figured the brilliant minds here could help. This site isn't in a database because its 3000 pages of HTML now and we figured we can do work arounds to make it look right. We are starting a database for future data though Code:
View Replies !
Extract Each Part Of A Page That Are Enclosed In A <b>-tag
I would like to extract each part of a page that are enclosed in a <b>-tag, but ONLY if there are no other tags enclosed. <b>some text</b> <-- a match <b>some text <i>in italic </i></b> <-- should NOT match This is what I have so far: $pattern = "/<b>(.*?)</b>/si"; preg_match_all($pattern, "<b>some text <i>in italic </i></b>", $out); Any thoughts?
View Replies !
|