php

merging XFDF with PDF form to create final PDF server-side?

This is what I have currently: User submits form data and gets a "download PDF" link. The link points to script which generates an XFDF file on the fly and outputs the XFDF file after setting the appropriate headers, etc. The XFDF file points to a password-protected PDF, which is the generic PDF form that uses the XFDF data to fill in ...

Undefined index in PHP

I have this error again: Notice: Undefined index: IDNUMBER in E:\wamp\www\PHP\create.php on line 5 Here is my code: <?php include 'E:\wamp\www\PHP\connection.php'; $IDNUMBER = $_POST['IDNUMBER']; $LNAME = $_POST['LNAME']; $FNAME = $_POST['FNAME']; $MNAME = $_POST['MNAME']; ...

Yadis authentication without OpenID

I am in need of an authentication system that would work in harmony with the current authentication system my client's server uses. The current system works as follows: A page requiring authentication invokes an in-house developed mod_auth Apache module in the .htaccess file. The user is redirected to a generic log in page. After ente...

PHP PunBB How to have the most recent posts of the forum on the home page?

I want to display the most recent posts in a punbb forum on the website home page, does anyone have the php code for this? ...

MySQL SQL getting most recent records in a table?

I have an sql statement as below attempting to retrieve the most recent entries in a table. So I have two questions: is it better to order by id or by date? how do I rewrite this sql statement to re-order by date? SELECT id, comment, DATE_FORMAT(entry_date, '%W %H:%i') FROM comments ORDER BY id DESC LIMIT 10 ...

How to convert array to list without .= in PHP?

I have the following array outputs. Array ( [day] => 17 [eventContent] => event 1 of 17th [eventTitle] => 17th event 1 ) Array ( [day] => 19 [eventContent] => event 1 of 19th [eventTitle] => 19th event 1 ) Array ( [day] => 05 [eventContent] => event 1 of 5th [eventTitle] => 5th event 1 ) Array ( ...

MySQL/SQL retrieve first 40 characters of a text field?

How can I retrieve a text field from mysql db table, but not the entire text, just the few 40 or so characters. Can this be done in sql or do I need to do it using php? basically what I am trying to do is show the first x characters and then let the user click on that to view the full content. ...

Approach in Joomla Template Design creating a Flexible Module

I'm creating a Joomla 1.5 Template based in 960 grid system. Now I'm having a problem with my modules. What is the best practice to control the width and how you display modules? Here's the scenario, in my footer I have 4 box (which will be my Joomla modules and each module has a width of '220px' with a margin of '10' in each side). ...

TCPDF UTF8 - weird spacing between characters

Pls have a look at the following picture http://dev.mosaicware.pl/tmp/PDF-utf-problem.png As you can se PL and RO characters are looking weird, they look fine on the webpage. Any clue? I've used arialunicid0 font and following code (characters in DB are UTF-8): $pdf = new models_PdfUtf(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, t...

Need help with hard regex

I need a regex that checks if a string only contain letters(a-z) and that the first letter is uppercase, you cant have 2 letters in a word uppercase Like: THomas or THomAS but Thomas Anderson (Thomas anderson too) would be valid look: The Magician Of The Elfs would be valid but not ThE MaGiCiAN oF ThE ELFS if (!preg_match("??", $name)...

[MySQL/PHP] Encoded query, no space

hi everyone. i would like to know if it is possible to create request with no space with MySQL ? i test the security of my own website, and i've put an str_replace(" ", "", $POST['id']); All sql injection becomes : id=-1 UNION SELECT pass... afet strreplace : -1UNIONSELECTpass i would have a hight livel securoty on my own website. t...

How to model a templating class

Hi all, I am writing a basic templating class for my own project. The basic usage is this: $template = new Template('template_file.php'); $template->assignVariable('pageTitle', 'Home page'); $template->render(); Contents of 'template_file.php': <?php print $pageTitle; ?> This is what template class does step by step: Stores vari...

Generic way to identify field in table

I am writing a sql editor (sqlite3). I can display a table and allow users to edit any value in the table but I now need some way of identifying the value editted. The problem is that I don't know what the primary key is and I don't think it's that good an idea to say "update table set a=b where x=123 and y=123 and z=123 and..." for all...

how to generate an dynamic array

I am a PHP Developer please help me ,i have problem to generate a dynamic menu to fetch data from database and store result in the dynamic array. ...

Why does this PHP function call work only once?

Hi, I've wrote a simple array, and I would use it to print an html list option set, with a selected element. My problem starts if I try to print multiple lists in my page, because only the first list is printed correctly, why? <?php $units = array ( '0' => 'Units', 'kJ' => 'Kilojoule: kJ', 'g' => 'Grams: g', 'mg' => 'Milligrams: mg', ...

Getting started with MySQL

I have a website that currently collects information when a comment is left (Name, number etc...) but right now I just have a PHP script that sends an email to me with that info using the mail() function. I don't know if MySQL might be extreme, but Id like a way to put their info into some kind of database. Thanks! ...

Which are the common security issues that the beginners make in php?

Yes, I'm a beginner. I wonder to know which are the main problems of security on a web site under PHP framework. Can someone give some link and/or some issue list? I would be very grateful, because I write php by some month but I have no idea about that! ...

How to conduct buffer overflow in PHP/Python?

Here is an example in c: #include <stdio.h> #include <string.h> void bad() { printf("Oh shit really bad~!\r\n"); } void foo() { char overme[4] = "WOW"; *(int*)(overme+8) = (int)bad; } int main() { foo(); } ...

How to pull out data from nested array in PHP?

This is a follow up question from here. But question is different. I have the following array outputs. Array $events Array ( [0] => Array ( [day] => 17 [eventContent] => event 1 of 17th [eventTitle] => 17th event 1 ) [1] => Array ( [day] => 19 ...

mysql multiple limit in one sql statement

I have table in my DB called "students" contains the following columns (student_id, student_name, year_of_birth).and array of years I trying to make one query that gets 10 student_id of each year in (years) array. I could write SELECT student_id FROM `students` WHERE year_of_birth=1950 LIMIT 10; SELECT student_id FROM `students` WHERE...