php

How can you use a url path as input to a script?

Say I am rolling out a CMS. Each user gets their own page at domain.com/username/index.php. At the moment I'm considering having a new account create a folder at said location and make an index file like so: <?php $username=blahblah; require("../indextemplate.php"); ?> Which would work fine. Everyone gets their own custom pages and su...

MySQL not pulling all rows.

Hey guys, first time using stackoverflow. can you guys help me debug? Heres the problem, this query is selecting all of the rows from my database, its only outputting the first one twice for some reason. $top10_query = "SELECT * FROM kicks"; $result = mysqli_query($cxn, $top10_query) or die("Couldn't execute query."); $row = mys...

Postfix as null client for multiple domains

How do I setup postfix as a null client for two domains on the same host? I currently have postifx setup as a null client for one of the domains (complete with SPF records). How do I add one more domain to the setup? And after adding the domain, how do I make PHP mail() send out email appropriately from the corresponding domains/IP addre...

Good Tutorials On How To Build A Tree Menu using PHP & MySQL.

I was wondering if some one knew of any good tutorials on how to build a tree menu using PHP & MySQL? ...

PHP Variables show blank if in html. MYSTERY

Hey Guys, I have a crazy situation that I cannot figure out: I have this string: $description = "<a href='".$link."'><img src='".$image."' border=0 ></a>".$description; and sometimes the printout looks like this: <a href='http://www.domain.com'&gt;&lt;img src='http://www.domain.com/image.jpg' border=0 ></a> Other Text and other t...

PHP server-side validation regular expression match

Hey guys, I have the following part of a validation script: $invalidEmailError .= "<br/>&raquo;&nbsp;You did not enter a valid E-mail address"; $match = "/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/"; That's the expression, here is the validation: if ( !(preg_match($match,$email)) ) { $errors .= $invalidEmailError; // checks...

Filtering out a number at the start of a string which has a certain pattern.

Hi, I'm trying to filter a number out of a string if that string starts with @. Here's what I thought would do the trick, but it returns nothing more than a blank page. (May contain lots of mistakes as I'm new to PHP.) <?php $String = "@1234 Hello this is a message."; $StringLength = 1; Echo "Filtering the number after the @ out of " ...

How to build an available web application

Hi everybody, Let's say that we are about to build an web application where high availability is top focus. Our customers are companies, so downtime are equal to loss of revenue for everyone involved. To sum it up, we need to be online at all times to keep everyone happy. So, from a very basic perspective, what techniques should we be...

Structured JSON layout

I'm working with JSON by PHP at the moment, when I encode it, it would output as: {"username":"ND","email":"[email protected]","regdate":"8th June 2010","other":{"alternative":"ND"},"level":"6"} When I would like it to output like this: { "username": "ND", "email": "[email protected]", "regdate": "8th June 2010", "other": ...

Can someone tell me how to obtain the theumbnail from a Blogger post using PHP/Zend?

Can someone tell me how to obtain the theumbnail from a Blogger post using PHP/Zend? ...

Need assistance finding the perfect PHP IDE for Ubuntu

I'm trying to build an application in PHP using my Ubuntu laptop. I'm having a hard time, however, finding an IDE that fits my needs. My ideal IDE would have the following features: Code folding Easy code snippet creation that is assignable to a shortcut key Code organization Unit Testing Debugger Netbeans fits most of these requir...

How can I carry POST data to a new page in PHP without a form?

Edit: I could simplify this question by asking is there a way to do something like header('Location: /msg_form.php?error=3') except sending error=3 and all the other form info via POST. I think the short answer is no, but there are alternative ways to do things. I integrated a message system into my website which used GET for everythi...

Get Data to PDF Form from MySql Database using PHP/JAVA

Hello All, I am working on project which need to get data from MySql database to PDF form. Can anyone please guide how can I solve this problem? I check internet for solution but I found I can create PDF form and get the data from DB to PDF form. My requirement are: I have PDF form on server I need to open that PDF form (using GUI) ...

CSS and browser compatibility

There are many ways we can deal with CSS browser compatibility issue. Such as using Box model design or developing different style sheets for different browsers or using Dynamic CSS techniques (writing PHP script in CSS file). Is there any way that we can know that Style which is being executed in the browser is supported by that brows...

How to retrieve subcategories of a given category

I've been looking around SO for a sec and been seeing questions about displaying categories and was wondering how would I display all my sub categories for my parent categories for example my link below? I'm using PHP & MySQL -Thanks in advance! Here is my link. http://www.example.com/categories/index.php?main_category=web-development...

PHP multiple forms and Ajax

I've put together a little script that works fine in general, it just needs a minor fix and some Ajax code. Basically, it appends a couple of forms to each output line. Submission works properly, 2 POSTS and 1 GET. But I'd like it to happen without a page refresh, ergo the Ajax code. I've tried messing around with some but the multiple v...

mysqli object how do I get the fields

Hi. I tried this: $result = $conn->query("SELECT * FROM temp_users WHERE reg_code ='$passkey'"); This works: if($result->num_rows == 1){ values from print_r($result); mysqli_result Object ( [current_field] => 0 [field_count] => 11 [lengths] => [num_rows] => 1 [type] => 0 ) but $result->username where username is a field in the d...

Counting words on a html web page using php

I need a PHP script which takes a URL of a web page and then echoes how many times a word is mentioned. Example This is a generic HTML page: <html> <body> <h1> This is the title </h1> <p> some description text here, <b>this</b> is a word. </p> </body> </html> This will be the PHP script: <?php htmlurl="generichtml.com"; the script ...

How to generate combinations of the elements in several arrays?

Hi, This is my first question here :) I have an array with a number of array children, each with unique values and would like to get all the possible unique combinations of those values. The number of arrays is known but may change over time. For example, array( [0] => array([0]=>'blue',[1]=>'red'), [1] => array([0]=>'sunny',[1]...

file_get_contents() with context to use http/1.1 significantly slow download speeds

Using the code below each image download) file_get_contents() ) takes on average 8-15 seconds..... If I do not use a context on file_get_contents() then image download is less than a second. If I change the $opts to, below then i get same performance as file_get_contents() without a context which takes appox 13 seconds to process 2,5...