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.





Isnt ^ Common Regex Notation?


isnt ^ common regex notation?

keep getting this error:
Parse error: syntax error, unexpected '^'

Code:

$goalsheet.=preg_replace("/^[0-9]+ Year Career Goal #[0-9]+: *$", "/^<span class=hd2>[0-9]+ Year Career Goal #[0-9]+: *</span><br>$/", $goallist);

aside from the error, i think the regex is off, but i hav had a hard time finding a tutorial that explains how I can ignore text in the middle. Here are some examples of what i'm trying to do:

"1 Year Goal #1: Web Developer" -> "<span>1 Year Goal #1: Web Developer</span><br>"
"10 Year Goal #2: IT Consultant" -> "<span>10 Year Goal #2: IT Consultant</span><br>"

suggestions?




View Complete Forum Thread with Replies

Related Forum Messages:
Str_replace - Open A File Of Common Words And Delete Every Occurrence Of A Common Word
OK so I'm not sure if str_replace is the best function to use, but here's what's going on:

I need to open a file of common words and delete every occurrence of a common word in a specified String (I also need to delete punctuation), then return a sorted array of the words in the string that are not common words. Code:

View Replies !
Sigma Notation In PHP
I searched php.net and other sites for information regarding Sigma
Notation (Calculus function) and the ability to create it, but with no
luck. Are there any alternate methods to pulling this off?

View Replies !
Converting Scientific Notation
I have a script that generates numbers beyond the range of it, and so it's
throwing them out as scientfic notation (e.g. 5E+10 instead of
50,000,000,000). The only way I've found of avoiding this is by using bc*()
functions in place of normal operators (e.g. bcmul() instead of '*').
Surely there's a way to simply convert a number in scientific notation into
a normal integer ?

View Replies !
Array Reference Notation
when referencing an array the notation is array[arrayindex] so if you have a two dimensional array shouldn't array[index1][index2] work? I'm trying to get $_FILES[myfile][name] and when I echo it I get Array[name]? If I do

$temp=$_FILES[myfile];
echo("$temp[name]");

View Replies !
Access Characters Within A String Using Array Notation
In C you could access characters within a string using array notation. For example
string a("test");

a[0] will hold the value of "t"
a[1] will hold the value of "e"
and a[3] will hold the value of "t"

Is this possible in PHP? What functions would I use?

View Replies !
Sends The E-mail Ok, But It Isnt Cc'ing ?
Sends the e-mail ok, but it isnt Cc'ing ?

View Replies !
Why Mysql Isnt Connecting
trying to get php to connect with mysql so that I can start querying db(running locally on my machine and php works fine) however I'm having trouble. This is the error it spits out-

Warning: mysql_connect(): Access denied for user 'ODBC'@'localhost' (using password: NO) in D:phpwebconnect.php on line 5

Unable to connect to MySQL

Could anyone assist me on this matter.

View Replies !
INSERT Code Isnt Working.
This probably has a really simple answer, but my INSERT code isnt working.

mysql_query('INSERT INTO `members`
(`id`, `uname`, `uemail`, `upass`, `GUID`, `data`, `permissions`)
VALUES ('NULL', $psuser, $psemail, $psPassword, 'NULL', 'NULL', &#391;')');
And I get an error saying
unexpected T_STRING .

View Replies !
How Do Sessions Work Cos Mine Isnt Working?
How do sessions work cos mine isnt working i got this:

on a different page i have :
$_SESSION['referer'] = '1';
then:
if ($_SESSION['referer'] == '1'){
include ("include.php");
}

but when i echo session it is blank =/ what did i do wrong.. i got many other sessions on the go so it should work..

View Replies !
How To Connect To Database Server That Isnt On 'localhost'
how to connect to database server that isnt on 'localhost'. are you suppose to replace 'localhost' with the ip address? i keep on getting a 'connect to error. could not find/connect to database'.

View Replies !
Script Isnt Pulling The Basename From Upload
This upload script im using for some reason wont pull the file name and database it when you go to upload a file and it wont upload the file either... I used this script before and got it to work but for some reason it wont work now.. I checked the other forms and they still work so i must be missing something in the script. Code:

View Replies !
Simple Image Upload Isnt Working?
im working on a simple image upload script (my first try) well i noticed that for some reason its not even recognizing a file being uploaded...ive tried using the phpfreaks simple image upload tutorial but that wont seem to work for me. Code:

View Replies !
INSERT Short Record = Fine, Long One Isnt
I have a mysql database table that I created by copying another one in phpadmin. The first table works fine. the second table works fine when I insert a short record, but when I do a long one it doesn't appear in the database. any idea what I'm doing wrong? It's not that its truncating the record, there is nothing there.

View Replies !
Security Code Image In PHPNuke Login Isnt Displaying
i installed the PHP Nuke in a remote web space bought from prackhost.Problem is that iam not able to get the security code to login to the site as admin or normal user. All the remaining images like links and logo are comming except that security code. Iam not able to do any furthur action.

View Replies !
Another Regex Question - Regex An Expression
I'm trying to regex an expression like this:

var1: val11 val12 ... val1N var2: val21 val22 ... val2M ... varI: valI1 ... valIJ

to get a something like this:

var1: val11 val12 ... val1N
var2: val21 val22 ... val2M
..
..
..
varI: valI1 ... valIJ

for example a multiple array.

View Replies !
Most Common Row
I know this is dead simple, but the problem is so am I... I have searched but cannot find the answer (it would help if I knew what to search for!).

Anyway, here is my problem:
I have a db table with many columns but I am really only interested in one of them: member_id.

A row is added to the table each time a member completes a 'transaction'.
So the member_id column is filled with many different ids some of them appearing more than once.

What I want to get is a list of the 10 ten members, i.e. the 'member_id's that appear most in the 'transaction' table (and the number of times they appear). How do I do this?

View Replies !
Common SQL Injection
What are common SQL injection methods that are used? I would like to test my site against them. Login Set Up Email: [input box] Pass: [input box] [submit button]

View Replies !
What Is The Most Common Approach To PDF?
What do you use to generate PDF files dynamically from your PHP.

I've been reading PHPFreaks about generating PDFs and, from what I had red, I was assuming most PHP server would have PDFLib installed - but it seems that's not a safe assumption. The PHP server my application uses is not mine, and it doesn't have PDFLib installed on it. I'm pre-empting the replies, but should I be asking the web server's system administrator to link in PDFLib?

View Replies !
Common Optimization
What are some common optimization practices? for mysql i use indexes and limit my numbr of queries, but whats common for php? ive cut down on how much coding there is, spliut the coding into different files (only call what i need).

View Replies !
Common Url For Whole Site
How maintain a common url for the whole site.Tell me how maintain it. when any link we click the address should be home address. I use the frame concept.but the site was developed using SAVANT2. it's not support the frames.

View Replies !
Common Database For Php And Java
how could I use common database for php as well as java.Is there any support for java available.Please some suggestion.

View Replies !
What Editor Is The Most Common In PHP Developer?
I am newbie in PHP, Thanks for any advise.

View Replies !
Web Surveys: Common Practice
I am just wondering, what is the current best
common practice for online surveys:

1. allowing users to vote any number of times
2. allowing one vote per IP
3. requiring email address verification (seems overly complex for a survey)
4. setting a cookie on the web browser and allowing no more voting until
the user closes the web browser
5, other

View Replies !
Common PHP Files On Different Domains
I have several websites on a remote virtual server. These websites use the same software.  I am looking for a way to update all the common files at the same time, rather than uploading the same file via FTP to each domain. I can not INCLUDE() a file from a different domain.

Is there a way to use a common source file stored on one domain, to be used on multiple domains?

View Replies !
Common Cron Problems
I am having problems getting a cron job to run and was wondering if anyone could direct me to a list of common problems with crons.

- The script runs fine through the command line
- The script has 755 permissions (the same as the other files that run through cron)
- All of the other cron jobs run just fine
- The script has the same owner as the other files

I am at a loss. Any ideas for other things I should check?

View Replies !
Extracting The Ten Most Common Words
I want to extract the ten most common words out of a number of texts. The texts are located in a Mysql table and the rest of the website is written in php. How can I best solve this? Should I make a separate table with these keywords? Is there an easy way to extract the ten most common words?

View Replies !
Common Include Files
I'm looking for opinions/thoughts about from whomever uses version control (I'm just starting to use subversion now). I have several "applications" running on my server. Each application references files in a general includes folder (include('includes/class_Database.php'), etc.).

I want to keep my applications separate, so other users can easily download/checkout versions, but I also want prevent duplication of effort: if I change my database abstraction class, I don't want to make changes to twenty different copies of the same file. If anyone has any ideas about this, or about using version control in a web environment in general, I'd really appreciate your input.

View Replies !
Storing Common Messages.
I'm using some common text messages in my site.I'm thinking to store that messages in a template or something so i can use any where in my web pages.Is there any way to store this common messages other than array.B'cos i'm already using php arrays to store that.

View Replies !
Common To Use Session.use_trans_sid
Constructing my first web app, and wanted to enable session.use_trans_sid so that people without cookies could still use my site. After braving a nightmare of set_ini(), and .htaccess to try (without joy) to turn it on, I find when searching for help that the vast majority of people are trying to turn it OFF.

Now I know there are potential security risks with people mailing or posting links with session ID's embedded, but surely support is still needed for non cookie people? Is it common practice now to only support cookies? Do people roll their own non-cookie support somehow instead?

View Replies !
Define Common Functions
How can I define a common utility functions in the utility class and then i want to use the function in many other classes. I don't want to define in each class.

View Replies !
Common Occuring In An Array
I have an array of about 100 product ids, some of my stores stock them some dont. What Id like to do is find the most commonly available products across all stores. So I have product id's such as s1,s2,s3 etc. in an array. How would I loop through them, take a count of duplicates and then echo out the results based on most commonly stocked items?

s1 (18 stores)
s9 (12 stores)
s2 (10 stores)
etc.

View Replies !
How Maintain A Common Url For The Whole Site.
Anybody know How maintain a common url for the whole

site.Tell me how maintain it.I Don't know how i do it?

View Replies !
Common Words In Same Field
I want to find what words are common between n number of strings. The strings will come from a mysql database. I might be comparing 2 strings, or 200 strings... the number is dynamic.

An example:

input1 = "The credit card was denied because it has expired.";
input2 = "The snowman melted because he expired.";
input3 = "Because the time had expired, the game was over.";

I want to loop through my input strings, explode them, and do some kind of intersection to return this array:

[0] = the
[1] = because
[2] = expired

What do you think is the best way to approach this problem? Because my input strings are in a database, are there any mysql functions that could help?

View Replies !
PHP In Array Issue - Common Words
I have an array

$commonwords = array ("and", "he", "I", "in", "is", "it", "of", "that", "the", "to", "was","are", "as", "at", "be", "but", "for", "had", "have", "him","his", "not", "on", "one", "said", "so", "they", "we", "with", "you", "about", "an", "back", "been", "before", "big", "by", "call","came", "can", "come", "could", "did", "do", "down", "first", "from", "get", "go","has", "her", "here", "if", "into", "just", "like", "little", "look", "made", "make","more", "me", "much", "must", "my", "no", "new", "now", "off", "old", "only", "or","our", "other", "out", "over", "right", "she", "see", "some", "their", "them", "then","there", "this", "two", "up", "want", "well", "went", "were", "what", "when", "where","which", "who", "will", "your", "i", "&", "a", "good", "i'm");

Now I am trying to check if a perticuler search word containing any word which is in array.. so avoide them.. example:

if(!in_array($space_split['search_word'],$commonwords))
{
// some work
}

this is not giving me right result.. for example.. it is not avoiding some words like "a" "i'm" "&" and few others..

can anyone tell me what is this issue?

View Replies !
Common Login For Diff Modules
I need to make a community site containing blog, forum, shoutbox, gallery, news, event calenders. Any one can give me suggestions like how can i make them accessible with one common login? Is it already handled by joomla or any other cms?

View Replies !
Pre-caching Common Queries On A Database
In trying to improve the performance of searches on a database, I read that it makes sense to run a small set of common queries off-line and cache them in a plain HTML file, and then use HTTP Location: to point to the static page. Problem is the book I read only talks about CGI. Can anyhow tell me/point me in the right direction for doing a similar thing using PHP?

View Replies !
Common MySql Search Algorithms In PHP?
I need to put together a simple search function. I imagine there is
already some PHP code out there that handles the basics?

For instance, how do I search for just words, from one word boundry to
another?

View Replies !
Common Causes For Apache Exiting With SIGSEGV?
I have a website that's built with PHP and MySQL and it works just
fine, most of the time. However, when the load gets higher (say 3
hits per second), Apache starts to exit with SIGSEGV on almost every
request.

Are there any typical areas to look at to solve these kinds of
problem?

View Replies !
Sharing Common Files Between Sub-domains
I'm looking for some ideas and best practices for setting up my sub-domains to make sharing/including common files among different sub-domains easy.

Specifically, I am looking for a solution that will make it easy to reference common files in the PHP script as well as referencing common images within the HTML. This is particularly a problem when including files in a PHP script that may include other files - can't use relative pathing.

For example, let's say I had this folder structure:

mydomain.com
 |
 |--sub1.mydomain.com
 |
 |--sub2.mydomain.com
 |
 |--images
 |
 |--includes

I could create a $prepath varaible with the value ".." for the subdomains and "" for the main domain. Then use that to reference all files from the root of the main domain. Of course I would have to reference any images in the HTML with a full path from the main domain only.

View Replies !
Passing Variables - Best/Common Practices
When I pass a variable from one page to another using something like

"www.mysite.com/page2.php?order=user_id&dir=asc"

This is in plain sight in the address bar. In the example above I am passing the name of one of my DB fields.

Should I be concerned about users seeing the names of my DB fields?

Without using a form, how would I pass these same variables via a POST (if possible)?

What types of information/variables (aside from personal info, passwords, credit card#'s etc...) should be passed using sessions?

Being new to PHP I am looking for general "best practices". I'd rather ask at the start than have to unlearn bad habbits later.

Thanks

View Replies !
& MYSQL - Was SearchWord Not Found Or Too Common
I am aware that when using the following sql in mysql, that it will not return results where the word is too short or too common:

SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('MySQL');

How would I go about telling if a word has been excluded because it is too common, or because it was not found?

View Replies !
Common Email Characters Not Accepted By Mysql
I'm making array of characters to replace with temporary proxys (equalsign, singlequote, doublequote, etc.) that will be switched back the original character when a user views his or her emails. For those of you who've done e-mail scripts with mysql before, which characters have proven to be the most trouble (I'm only imagining how many emails one email could hold up if checkmail.php's error array didn't have a certain charactter)?

View Replies !
Failed Opening Required 'common.inc'
I get this fatal error message when i try to include the 'common.inc' file. Could someone explain where common.inc and php.ini should be located and what their contents should be. I am running an apache server and php4. I found 3 different 'common.php' files in different locations within the php directory.

View Replies !
Reusing An Object For Common Select To Database
I've noticed that after I finished this app, I had repeated a similar task over and over and would like to modularize it. The repeated task was connecting to the database, executing a select, putting all the results of the columns into different variables of an object. PHP Code:

View Replies !
Forum Integrating Into The Common Web-site Interface
I am developing a dynamic site and I'd like to have the communication place for users of my web-site. For this goal I'd like to use phpBB, I like it. But I don't want to open this forum separately in another window or in the same with another design. I'd like to save the common web-site design (navigation menu on the left side of page, header and feuilleton).

View Replies !
List Of Common Words Mit My Keyword Search?
Seeing if anyone had a list of common words (the,a, as, of,...) so that I can limit my keyword search. I do not want to use the length of the word to limit.

View Replies !
How I Can Find Longest Common Prefix Of Strings
I'm interested in such algorithm that solves problem of finding longest
common prefix of two or more strings.

I haven't found such function in PHP, or I pass it?

View Replies !
Mailer Script With Common Validation Rules
Can anyone recommend a comprehensive php form mailer script that includes common validation rules such as checks for valid email addresses, phone numbers etc?

View Replies !
How To Make Certain Pages Point To Common Database?
I've got a series of duplicate sites running, not 100% duplicates but similar and they're all part of the same network of sites.

The thing is, I need certain pages of the copied sites to pull their information from the main site. But not the entire database should be pulled from the main site. Code:

View Replies !
Join Two Table That Have UsedID And Msepcdp Userid In Common.
I used this SQl query to join two table that have usedID and msepcdp userid in common.
"SELECT * FROM users,msepcdp WHERE users.ID = msepcdp.userid AND msepcdp.type LIKE 'music"
Wheni i try to echo the the fields using:

"$query2 = "SELECT * FROM users,msepcdp WHERE users.ID = msepcdp.userid AND msepcdp.type LIKE 'music'"; Code:

View Replies !
Failed Opening Required './libraries/common.lib.php'
Upon running the "setup.php" file to create/configure "config.inc.php" I received this error:

" Warning: main(./libraries/common.lib.php) [function.main]: failed to open stream: No such file or directory in /srv/www/htdocs/phpMyAdmin/setup.php on line 10

Fatal error: main() [function.require]: Failed opening required './libraries/common.lib.php' (include_path='/usr/share/php') in /srv/www/htdocs/phpMyAdmin/setup.php on line 10"

What does this mean? How do I fix it? "common.lib.php" exsists as well as all mentioned directories, I checked. I was just checking my PHP test page, and discovered that in the configure command section it reads '--without-mysql'. Now, I'm not sure if that has anything to do with it, but figured I'd pass it by you incase it did.

View Replies !
Common Prob With Mysql LOAD DATA LOCAL INFILE ...
i have most recent php & mysql versions running on a linuxmachine

i want to use LOAD DATA LOCAL INFILE and pass it from php to mysql.

- the file i load is given with full path and the directory is readble
- On MySQL local-infile = ON
- From PHP i connect using client flag (128) to allow passing a file over
that connection: mysq_connect( $host, $usr, $pwd, false, 128)

Ive followed all advice from php & mysql sites and deja.com ...

But i still get the message: The command is not allowed with this MySql
Version or something ...

any ideas where i should look further?

what are *all* the requirements for a LOAD DATA LOCAL INFILE to work
seamingly?

View Replies !

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