php

Problems installing PEAR MDB2 with MAMP

I've installed a copy of MAMP on my macbook so I can run my php/mysql based website locally. The MAMP package itself seems to work fine but I needed the PEAR MDB2 Package. I did the following to install pear install MDB2 pear install MDB2_Driver_mysql pear channel-update pear.php.net All apparently worked and if I try again, they s...

How to join 2 tables & display them correctly?

http://img293.imageshack.us/img293/857/tablez.jpg Here is a picture of the 2 tables. The mybb_users table is the table that has the users that signed up for the forum. The mybb_userfields is the table that contain custom profile field data that they are able to customize & change in their profile. Now, all I want to do is display all ...

PHP - import data into a excel template

Hello, first off I am fairly new to php like 3 weeks working with it, and am loving it so far. Its a fantastic language. I am running into a issue though, I have a client who wants the information collected in on a form on this website to then be imported into a excel documents that he already has created. Since I am fairly new I've bee...

How to display a students rank out of hundred students using PHP & MySQL?

I'm trying to get the rank of a certain student out of a class of a hundred, I want to be able to display the students rank. I'm trying to get the rank of a student by grades and grade points. For example if student 1 has 2 A+ grades with a total of 10 points and student 2 has 3 B- grades with a total of 10 points student 1 will rank hi...

I want to ascend and decend MYSQL from a value in the database.

I want to ascend MYSQL from a value in the database. Hypothetically: database with table tbl_numbers column numbers has 10 values in it 1-10. I want to: order by numbers desc {from 8} LIMIT 3 it would show 8 7 6 instead of: order by numbers desc LIMIT 3 10 9 8 If this is possible what php and not mysql that's good too. --upda...

JSON to PHP Associative array

Hey guys, would any of you know a good way to put this into an associative array . I have tried json_decode but found it to not be much help and: preg_match_all('|"name": "(.*?)",|',$json,$matches); Seems to match it (in expresso) but returns an empty array in php. This is the data i need to put into an associative array: { ...

Help with header() php

Hello I want to refresh a script from the server when back button is pressed. For that, i'm using this code: header( "Last-Modified: " . gmdate( "D, j M Y H:i:s" ) . " GMT" ); header( "Expires: " . gmdate( "D, j M Y H:i:s", time() ) . " GMT" ); header( "Cache-Control: no-store, no-cache, must-revalidate" ); // HTTP/1.1 header( "Cache...

How to move a marker 100 meters with coordinates

I have 2 coordinates. Coordinate 1 is a 'person'. Coordinate 2 is a destination. How do I move coordinate 1 100 meters closer to coordinate 2? This would be used in a cron job, so only php and mysql included. For example: Person is at: 51.26667, 3.45417 Destination is: 51.575001, 4.83889 How would i calculate the new coordi...

Pathauto stopped working

Hi, I'm on a critical situation. I have a website with a lot of content (500+ nodes). However, all of the sudden, URL aliases stopped working. I get page cannot be found even nodes exist. I tried editing an existing node with a different alias to see if the module worked and it didn't. However, if I disable the Pathauto module and ju...

Does anyone have any experience using berkeley db with PHP?

I have to access and write to some berkeley db files that other applications share. I really haven't found anything out there about using this with PHP. It really doesn't seem very popular. Does anyone have any links or resources that I might be able to use to get things rolling? Thanks! ...

Do not work a transfer of a variable.

Possible Duplicate: Data transfer from JavaScript to PHP. How can i get the browser's height and width to php? Like a data transfer from javascript to php? With using innerHeight and InnerWidth, i think. (I just need to show user small picture if he has small screensize and big if big and without a data about screensize i can...

newline not working in PHP mail

I'm using the following to send an email: <php .... $message = 'Hi '.$fname.', \r\n Your entries for the week of ' .$weekof.' have been reviewed. \r\n Please login and View Weekly reports to see the report and comments. \r\n Thanks, \r\n'.$myname; mail($to, $subject, $message, $from); ?> When the message is received it does not st...

What's the problem with my php generated png file?

Hi! I want to make a unique forum signature from my latest watched animes in PHP. These are contained in an RSS feed. On my local apache server, the image is generated well, but as I upload it onto a server, I get an error, the picture isn't generated at all. Here is my code and I wonder what's the problem since neither Dreamweaver CS5...

Convert int bytestream to a float bytestream

Hello, I have a 32-bit integer. The bit stream is actually a bit stream for a 32-bit float (IEEE 754). I tried converting it with: unpack('f', $input); This generates a float, but it seems it is not the right number For example, if I pass in 1, I should be coming out with 1.4012984e-45, according to the IEEE754 converter, but I am c...

Making the nodes to ignore namespaces (prefixes) after changing XML structure. PHP DOMDocument

Hello. Original XML (myfile.xml) <?xml version="1.0" encoding="UTF-8" standalone="no"?> <blabla xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:blabla="http://www.w3.org/2000/blabla" xmlns="http://www.w3.org/2000/b...

How to handle HTML code that repeats a lot

I have some HTML code portions that repeat a lot through pages. I put this html code inside a function so that it is easy to maintain. It works perfectly. I, however feel this may not be very good practice. function drawTable($item){ ?> HTML CODE HERE <?php } I also run into the problem that when I want to return data using json th...

Complex edit xml file

For example, we have this xml: <x> <y>some text</y> <y>[ID] hello</y> <y>world [/ID]</y> <y>some text</y> <y>some text</y> </x> and we need to remove words "[ID]", "[/ID]" and text between them (which we don't know, when parsing), of course without damage xml formatting. The only solution i can think is that: ...

Getting LightVC Quick Start Guide Example to Work

Hi, I've got LightVC installed and running so that I can see the default LightVC page. Unfortunately, when I try to run the Quick Start Guide example I get a 404 error. Any suggestions would be much appreciated. Jude ...

Will my site be secure?

Hello all! I'm just about to release a website I've designed into the wild, but before I do, I would love some help determining whether I have made any silly security mistakes. Since I'm using shared hosting rather than dedicated, this is a very important concern. After much research and tutorial-reading I've done the following: All P...

Why PHP variables start with a $ sign symbol?

Has anybody ever thought about this question. Why we must write $var_name = value; and not var_name = value;? Yes I know that it is the syntax rule that PHP uses, but why is it a $ sign symbol? ...