Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP






SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Regexp - Get Whats Between The <td></td> Tags.


I am having trouble with the following. I'm not getting any error and I have exhausted everything I can think of so any help would be appreciated. I am trying to get whats between the <td></td> tags. It needs to start at the HP because it is just a segment of a larger string. Itried a bunch of different combinations but the following 2 didnt return any errors, just not the data I want.

<td>HP</td><td>2132</td><td>210</td><td>99</td><td>2441</td>

preg_match_all("/HP(<[.+]>)+([d+])</[.+]>/si",$file,$matches);

preg_match_all("/HP(</?[.+]>)+([d+])</?[.+]>/si",$file,$matches);




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
<?php ...<? Both Are The Php Tags Whats The Diff
<?php ...<? both are the php tags whats the diff b/w name of the
tag??? then
i write the code using <? this tag full coding , but the server can
not accept my (<?)tag,, its only used <? php tag only

View Replies !   View Related
How Do You Prevent A User From Using Certain Tags Such As Html Or Vbscript Tags When Typing Names Etc In A Form?
how do you prevent a user from using certain tags such as html or vbscript tags when typing names etc in a form?

View Replies !   View Related
Include Some Dynamic Tags Such As A Date Format Tags
I'm building a very simple templating system, that will allow partners to create/edit custom templates. I want to include some dynamic tags such as a date format tags. which would look like

<tag:date format="m.d.y"/>

I was thinking of using XPath, however I found that when using DomDocument with LoadHTML or LoadXML that it was very particular about the formating and if it was messy code.

View Replies !   View Related
Counting Tags And Writing Missing Tags
sometimes people just forget to close formating tag while writing message in forum (or enywhere else) so I wrote those lines (for <b>, <i> and <a> tags) Code:

View Replies !   View Related
Text Links To <a> Tags, But Leave <a> Tags
As the title says, all I need to do, is convert (maybe multiple) text links (eg. http://bla.com or ftp://bla.com) to plain simple html links (<a href="http://bla.com">http://bla.com</a>)

I have search the forums, but did not seem to find anything.

View Replies !   View Related
Using Strip Tags On Text Which Has Html Tags
I am using strip tags on text which has html tags, but for some reason it wont remove table tags (td, tr, etc.). How can I remove them?

View Replies !   View Related
Whats The Best Way To Do This.
I read about 10K rows from mysql (just char field) and i need to divide them on about 10 select menus..

and they will be hidden and only one will be displayed upon user choice of other select menu.

so someone has helped me with the hide/show in javascript section, but i dono how to put them in select menu in a fast way for loading.

is it possible to built 10 different select menu in for loop where am reading from mysql and i check my condition to fill the corresponding select menu?

i cant c its possible unless by having new 10s select menu each time it loops...

the thing is that i dont wana read the 10K rows each time to build each select menu..

any clue?

View Replies !   View Related
Whats The Best Way To Do This?
I currently have a website that uses an option drop down box to
select different colours for an item before the form it is in is
submitted.

This works fine but as I am trying to advance my skills I decided to
learn PHP to use with SQL which I already know. I have yet to start but
am thinking of how to go about it and looking at some example code. The
whole thing looks easier enough but I was wondering how these option
boxs would fit into it.

I'm thinking one way to possibly do it would be an array with all the
options in. However, would it be possible to have what should be the
contents of the array as part of the table? For eg something like:

Colours
-----------
Blue,black,green

And also would it be possible using these to change the price of an
item? That isn't so important now but may be useful in the future,
although I can make it work another way if need be.

View Replies !   View Related
$end Whats It Mean?
whats $end mean im getting it when i try and run the php script.

View Replies !   View Related
Whats The Deal With IIS?
When I develop my applications, I use Apache, and everything works great. I can set cookies, use variables great and so on. BUT, my server is using IIS and it is ruining my world: I can't set cookies!!

I hate it. I got it to work by changing a piece of code from a header redirection to a header refresh BUT the only expiration time that works is the number 0. So the users of my app, can just close the goddamn window and vote again(or whatever).

View Replies !   View Related
4 XML: Whats Wrong With This?
All i need is someone to help me with my script so that every node in the array goes through the if..else.. statments, with the end result of an array of $albums and an array of $images. Code:

View Replies !   View Related
Post And Get, Whats The Difference?
I just want to know the difference between the post and get method of a form...when do i use post or get...like when im creating an application/membership form. does the two methods have different impacts on the script triggered by the submit button.

View Replies !   View Related
Whats The Deal With Functions
I am trying to call a function which I have declared in another PHP file which I have included in my main script. but when I run the script I get a fatal error. I don't get it, can't you declare function in a seperate include file and use the include or require statment to include it in the current php file?. PHP Code:

View Replies !   View Related
Whats Really Faster, PHP (as Module) Or CGI?
There is alot of debate that I see over what the fastest script is among certain people who really don't know much. So for a script that displays no content, just some MySQL work, some calculations, and some headers, what is faster: a PHP script run as Apache module, or a CGI written in C or C++???

View Replies !   View Related
Whats Changed Since PHP Persion 4.3.10?
I've not coded php for a couple of years now and, for some reason, I decided to refresh my memory.  I opened an old script I had been playing with back then and started editing, and testing on my local machine.  I have Apache, PHP Version 4.3.10 and MySQL installed on my machine which I have had installed for what must be two and a half years. 

When I test locally, the site (what there is of it) works perfectly, correct includes are called, menus expanded and menu items highlighted when chosen. When I upload it to my host (which is apache based and supports both PHP4 and 5 (PHP Version 4.4.7 installed)), the initial page is correct, but when I click on any menu item, includes aren't called, selected menu items aren't highlighted or expanded.

View Replies !   View Related
Getting Whats Its In The Address Bar As A Variable
i need to get the address path of my page as a variable, it changes depending on the id and settings of user so i cant make it a fixed one.

View Replies !   View Related
Whats The Point In Session Id?
Whats it really used for?

session_id(); ?? // I know its about the current session id, which is like some weird hash
PHPSESSID // same thing..

why do you need these two things? I just don't get it!

View Replies !   View Related
Whats The Best Captcha Script Out There ?
I want one that is not that distorted but is still considered extremely effective against spam.

View Replies !   View Related
Whats The Mimetype Of .xls In File??
is this correct ?

($_FILES['sql_file']['type'] == 'application/xls.ms-excel') i need to upload a file in xls format excel type and determine its type before uploading and i dont know the type to be used whats the mimetpye of .xls in file??

View Replies !   View Related
Sorting Data - Whats The Best Way?
I have a number of members stored in my database, and i would like to create a page to allow people to browse through the members and see certian bits of information.

I would like this page to be dynamically ordered (sorted) by the date the information was last updated, thereby keeping the most up to date information at the front, and penalising those that dont update often.

I am thinking of simply adding a field in my database, and inserting a gregorian timestamp (based on the servers current date) everytime a member updates the info.

Firstly, is this the best way of keeping track of updates ?

And, how would i go about ordering my data by this particular data?..... does php have an "order by" function?

View Replies !   View Related
Whats Wrong With Magic_quotes_gpc?
People say magic_quotes_gpc should be turned off in php.ini but I dont see the problem?!

$name = "O'reilly";

Would be O'reilly - therefore saving the extra line of code to addslashes. So why should it be turned off?


View Replies !   View Related
Can Someone Tell Me Whats Wrong With This Script?
When i submit form to this i get:

Warning: fread(): Length parameter must be greater than 0. in /home/jabbic/public_html/Jamies Cookies And PHP :P/post.php on line 4

Warning: fopen(djsays.txt): failed to open stream: Permission denied in /home/jabbic/public_html/Jamies Cookies And PHP :P/post.php on line 10
Couldn't open djsays.txt Code:

View Replies !   View Related
Whats Wrong With This Session Code?
im learning about sessions but the book im reading has hit a snag. heres the code for 2 seperate pages.
page1.php

View Replies !   View Related
Whats The Deal With Register Globals??
Ok, in all the time I've been here I see register globals problems coming up all the time. I've never had a problem with this yet, so could someone explain (in simple format) what this is all about, and why so many people have a problem with it?

View Replies !   View Related
Whats A Good Way To Write GUI Apps
I need to write a couple of small GUI applications but have never
done so on Linux (I'm a C/Delphi programmer on Windows normally)

I'm fairly conversant with linux but have never written any code for it.

I know this tends to be subjective and I dont want a flame war but can
anyone suggest the best language to learn to do this with?

View Replies !   View Related
Whats Wrong With This Security Script?
This script is meant to limit access by sessions, using username and
password from mysql db and redirect users after login according to a
given value belonging to each user in the db (10,20,30,40).

(the included config is just server settings, the login is just a
login form).

The script appear to connect but will not redirect users, it seems
that even with correct login details, it won't validate.

this code is in top of each protected page granting access to users
with user level 10:
<?php $allow = array (10);include ("../protect/protect.php"); ?>

THE SCRIPT (protect.php):......

View Replies !   View Related
Navlink Count - Whats The Best Method
I'm writing a guestbook and given the number of entrys the guestbook
might have can vary quite a lot - the nav links to view the guestbook
entrys need to generated live at the time to suit .

Whats a good method to get the effect .

View Replies !   View Related
Whats Wrong With My Mail Function?
I have a form in which a user subscribes to a mailing list, and it sends out an email to the admin saying this user wishes to subscribe to a mailing list. this code was working at one time, and now it doesnt. I was the one who originally wrote it, and to my knowledge no one has touched it. PHP Code:

View Replies !   View Related
Function For Finding Out Whats The Next Date?
Say I have a date, 2003-02-17. Is there a function within PHP which will return the next date, 2003-02-18, or...? Anyone have one?

View Replies !   View Related
Ora_parse Error - Whats Wrong?
this one's had me stumped!

$conn=ora_logon("cricketunes@pickles","j8j3kf");
if ($conn != TRUE)
die("Unable to connect to oracle, exiting...
");

$cursor = ora_open($conn);
if ($cursor != TRUE)
die("Unable to open a cursor, exiting...
");

$result = ora_parse($cursor,$query);
if ($result != TRUE)
die("Unable to parse SQL block<BR>");

Warning: Ora_Parse failed (ORA-00911: invalid character -- while
processing OCI function OPARSE) in add.php on line 33

What is wrong with my ora_parse function call?

View Replies !   View Related
Whats The Cross Domain Cookies
Any one say how to set a cross domain cookies. for example my site is <a target="_blank" rel=nofollow href="http://www.damu.com">[link]</a> i set one cookie in this site but i want to use the same cookie in another site:

best example :

if i login gmail using my login user name and password .then same
browser new tab i open orkut.com its login automatically. using my...

View Replies !   View Related
Whats The Best Way To Handle The Upload Images
What im trying to do is make a form with the usual username,password, and email fields but at the bottom before the form is submitted there is an option to upload a photo, i have made the code this:

<input name="userfile" type="file" size="50" />

theres no upload button as the main button at the bottom of the form is meant to pass all the fields including the upload file one,

but im not sure whats the best way to handle the upload, i put the "userfile" into variable on the submitted page but should that go into the MySQL database (the photo i mean) or is there another way to do this.

View Replies !   View Related
Whats The Diffrence Between A Session And A Cookie?
Whats the diffrence between a session and a cookie?

and sessions are called like
$var1 = 'Hello World!";
session_register("var1");
$var1 = $_SESSION['var1'];

How how exactly are cookies called?

View Replies !   View Related
Constructing An LDAP Query - Whats In The URL?
I have a nice little php script to query my LDAP/AD and perform a search. I now want to pass on the search variable of 'q' to a AJAX live search.

I'm almost there I just need to know what the query in the URL is.

For example when we use google the basic search query is google.com?=Yoursearchterm

so what is the URL actually sending for and LDAP/AD search?

This is my script .....

View Replies !   View Related
Whats The Difference Between A Session And A Cookie?
Whats the difference between a session and a cookie?

View Replies !   View Related
Restricting Whats Displayed By Amount
I have a events calendar, that alows guest users to add their attendence, but what I want to do is not show the add attendee button once the amount of attendees reaches the amount of spaces on the course.

What would be the best way to do this. The add attendee function is added to the page in an include.

View Replies !   View Related
Whats The Best Language For Coding Graphs On The Internet?
Whats the best language for coding graphs on the internet?

View Replies !   View Related
Whats PHP's Equivalent Of Response.redirect
What is PHP's method of redirecting i.e. on the page which processes a login form i want to redirect depending on which passwords were put in and whether the passwords are correct.

View Replies !   View Related
Printing Out An Associative Array - Whats Wrong?
I have this code segment:

$query = "Select * from Payments order by CustID";
..
.. /* execute the query */
..
if (ora_exec($cursor))
{
$recordset=array();
while (ora_fetch_into($cursor,$recordset,ORA_FETCHINTO_N ULLS|
ORA_FETCHINTO_ASSOC))
{
echo $recordset["CustID"]."<BR>";
echo $recordset["Amount"]."<BR>";
}
}

Gives me the following error
Notice: Undefined index: CustID
Notice: Undefined index: Amount

The table Payments has only CustID and Amount as attributes. is my
usage of the array offset incorrect?

View Replies !   View Related
Whats The And Equals Operator Do In A New Instance Creation?
$val = & new val();

why do people use that?

when you could use
$val = new val();

I just want to know what  = &  means

I dont think anyone made a topic for this and its hard to search for symbols you get a billion topics nothing reliable.



My guess is that it makes it static?

View Replies !   View Related
Whats Safest To Do In Terms Of Security And Sensibility
what is better to do for security reasons and general better use of coding.. should php files be on their own and have the html files "include" the php file or just have the php with the html ?

View Replies !   View Related
Whats The Quickest Way To Extract Data From String?
As I have screwed my mod rewrite (!) I need to extract some information from the url.

www.mydomain.com/widgets_blue/type_001/id_#*$!x
www.mydomain.com/widgets_red/type_003/id_xxxx
www.mydomain.com/widgets_yellow/type_002/id_xxxx

"$id = $HTTP_GET_VARS['id'];" doesn't work for some reason if the url doesn't have a slash at the end...

www.mydomain.com/widgets_yellow/type_002/id_xxxx/

(If the slash is there, then it works fine?)

So I need to quickly extract the value of id (in the above examples 'xxxx').

Whats the best way of doing this? I was thinking about moving it into an array and reading backwards(?).

View Replies !   View Related
Whats The Best Way Of Making A Livepage? (refreshing Page Data)
So I am trying to make a kind of Livepage/chatroom thing where people can comment in a chatroom-type interface... (kinda like IRC)

I am doing it in PHP and saving all the messages into a MySQL table.. the table will empty at the end of each day or two or whatever to save space..

So when a user enters a messages and hits submit, it will save it to the MySQL database and refresh the page...

But what about incoming messages? What, in your opinion, is the fastest and most seamless way of getting the new info from the database, or am I going about this all wrong?

View Replies !   View Related
PHP And Dates? Whats Wrong With Timestamp And Julian Callendar (for Experts)
$DOW = (jddayofweek(unixtojd(mktime(1, 1, 1, $month, $day, $year)))+6)%7;

$DOW= (jddayofweek(juliantojd($month, $day, $year))+6)%7;

The results are supposed to be the same, but they are not. Whats wrong? Any
clues?

View Replies !   View Related
Whats PHPs Version Of ASPs Application Scope Variable
In ASP you can create a variable that is accessible by all scripts in
an application.

Is this possible in PHP? Storing a multi-dimensional array in memory
has much greater performance benefits than storing in a database or
session (which just gets saved to disk anyway). Id like to have my
commonly used application variables in memory.

Is this possible or is it one of the few flaws of PHP?

View Replies !   View Related
Whats The Most Efficient Way To Split An Associative Array At Defined Keys?
whats the most efficient way to split an associative array at defined keys? the main purpose of this is to delimit a $_POST request with key/value pairs that identify what form they belong to. Like: Code:

View Replies !   View Related
Regexp... Help?? Please....
I was trying to understand how this regexp work but the regexp reference is like written in chinese...

anyway, what i'm trying to do it get all block between certain characters... like HTML...

for example, i need to replace {b}text{/b} to <b>text</b>... this structure can have multiple levels like

{b}stuff {i}here{/i} or here {html}<b>html</b>{/html}{/b}

of course, i could just replace {b} to <b>, but how can treat html blocks between {html}{/html}... I'm sortof writing forum here and need such feature as my own markup language.... any help?

View Replies !   View Related
Need Help With Regexp
I would appreciate if someone could take a look at this and tell me what I am doing wrong with the regexp. No matter what I do I cant seem to get it to display both int without it displaying the preceding '(' Anyhelp would be great.

Function Printthis()
{
$url = "test.txt";
$fp= fopen( $url,"w+");
$charSta = "document.getElementById("agi").style.color=getColor(18);

preg_match_all('!document.getElementById([^>](.*?)").style.color=getColor([^>](.d+))!is', $charSta, $matches);

for($i=0; $i<count($matches[0]); $i++)
{
$match1 = $matches[1][$i];
$match2 = $matches[2][$i];


fwrite($fp,"$match1= $match2");
fclose($fp);
echo "&$match1= $match2";
}

}
echo (Printthis());

View Replies !   View Related
Could It Be Done With REGEXP?
After reading the explantion about regexp and perc in the php manual twice i am still having problems with the entire thing.
as long as "simple" regexp everything is fine, but this time i have something which i m not sure is at all possible but i think its worth asking.

this is how it goes:
i have this string (with unknown length could be 0 and could be anything other than 0), retrived from a database.
in order to make it readable i need to add the <br> tag since the text was originally entered by the textarea. in order to do that nl2br would be good engoth BUT...
i need to limit the text so that when it is echoed to the html page, it will contain the <BR> tag where it should be ( instade of the "
") and check to make sure that the length of each line is no more than 50 characters. if there is no
for 50 characters then i should add the <BR> tag in order to continue in a new line.
now again a problem if the place where it gets to the 50th character is somewhere in the middle of a word then the word itself should not be cut in to two, but be moved to the next line.... that does make sence right?
i know i can do it using a for loop and echo each word after counting the total characters from the last BR but i was wondering if there is any better more elegant way of doing it?

View Replies !   View Related
Need Help With An REGEXP
I am unfamiliar with regexp. I found this piece of code and am just trying to see how to modify it:

View Replies !   View Related
Regexp Help..
I am trying to extract the headlines/url's under the "technology" gif at http://www.techweb.com/newsPopUp/content

I am using: preg_match_all("/<a href="http://www.techweb.com/wire/story(.+?)">(.+?)</a>/i", $page, $news, PREG_PATTERN_ORDER);

This SHOULD work (I think), but there seems to be a problem in receiving the first (.+?). The second, which is the headline is received fine.

View Replies !   View Related
Regexp
$html="<b><a href="url">somthing</a><br><a href="url">somthing here</a>";

What I need to do is collect all the html links inside a string (<a href="url">somthing</a> ) and add them to an array.

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved