php

mysqli and php requesting rows returned in object oriented scripting...

in object oriented php mysqli I am trying to request a username, and return if it matches a row, without actually returning any user data. How would I write this?...so far I have... $sql = "SELECT NULL FROM database WHERE usernick=?"; $stmt = $link->prepare($sql) $stmt->bind_param('s', $snr); $stmt->execute(); After this step I need...

I need some help cropping an image in PHP (GD)

http://i.imgur.com/foT9u.jpg Using that image as an example, here's what I need to do: Crop the blue square to have the same proportional ratio as that of the black square From doing that, I should then be able to resize the blue square to fit into the black square without stretching it - It'll retain its proportions. Note: The blue...

Symfony Jobeet Tutorial Day 3, databases.yml error

Hi all, I'm new to Symfony and I'm going through the Jobeet tutorial v1.4 for Doctrine. I am currently stuck on Day 3. I've followed all the instructions on configuring the database and building models and modules; however, when I try to access "http://localhost:8080/frontend_dev.php" I receive the following error: 'Configuration "conf...

PHP OO vs Procedure with AJAX

I currently have a AJAX heavy(almost everything) intranet webapp for a business. It is highly modularized(components and modules ala Joomla), with plenty of folders and files. ~ 80-100 different viewing pages (each very unique in it's own sense) on last count and will likely to increase in the near future. I based around the design arou...

Select random line in SQL database

Hi, I would like to select a random line in my database. I saw this solution on a website: SELECT column FROM table ORDER BY RAND() LIMIT 1 This SQL query run but someone said me that it was a non performant query. Is there another solution ? Thx ...

How to maipulate the shell output in php

I am trying to write php script which does some shell functions like reporting. So i am starting with diskusage report I want in following format drive path ------------total-size --------free-space Nothing else My script is $output = shell_exec('df -h -T'); echo "<pre>$output</pre>"; and its ouput is like below Filesystem T...

How to use PHP to POST to a web page then get the results back, locally

I have a page on my web server that is PHP that is set to do this if ($_POST['post'] == true) { echo: 'hello, world'; } I want to create a page that calls to that page, posts "post" equal to "true" and then returns the value "hello, world". I have a script that works, but only if the pages are on different servers. Unfortunately, bot...

PHP / javascript live chat using too much bandwidth

So I am learning about javascript, so I am making a live chat system with PHP and javascript. I have it so the javascript refreshes the log (each message gets logged in a file on the server), and it refreshes every second. Im using firebug to monitor the resource usage, and I see under the net tab each times its updated, and the bytes ad...

any good class for generating graphs and pie charts

hi! I'm working on a project which includes generating pie and bar graph charts on the fly with user inputs. Can anyone suggest me some good libraries to do that? It can be any like jquery, css, php class or anything free.. And i'm going to use it mainly offline. Thanks :) ...

php and asp problem in uploading

i have an ASP web services to change byte array that given from the client and change it to a file and save it in the web server ...

Codeigniter Best Practices for Model functions

Say my application has a "Posts" model, and one of the function is add_post(), it might be something like: function add_post($data) { $this->db->insert('posts',$data); } Where $data is an array: $data = array ('datetime'=>'2010-10-10 01:11:11', 'title'=>'test','body'=>'testing'); Is this best practice? It means if you use tha...

how to share video file in mysite to facebook

Hi Friends, Now currently i am working on a french social networking site. I have small problem in my site i.e., in my site there is module of albums , In this we can upload videos and photos. My client requirement is when we are displaying those photos and video's need to keep face book share.i wrote the code for both image and video b...

How can we convert video files to .flv format in php.

Hi I have to convert video files to .flv format in php. any body have any simple scripts please give me. ...

Running a Model::find in for loop in cakephp v1.3

Hi all, How can I achieve the following result in cakephp: In my application a Topic is related to category, category is related to city and city is finally related to state in other words: topic belongs to category, category belongs to city , city belongs to state.. Now in the Topic controller's index action I want to find out all t...

PHPSecurityScanner & SpikePHPSecAudit - How do I?

Hi, How do I run PHP Security Scanner and SpikePHPSecAudit? I've already extracted them at the root of my website and thought it could be run like phpSecInfo where you just navigate to www.mySite.com/phpsecinfo/index.php Any assistance will be appreciated. ps I am using Windows XP and XAMPP ...

PHP mysql_fetch does not return values

Hi, Being quite new with PHP, I cannot find any solution why this does not work. The query is OK and the resource is returned. But I dunno why fetch_assoc does not print values. Thanks $query=sprintf("SELECT ID,NAME FROM USERS WHERE PASS='%s' AND NAME='%s'",mysql_real_escape_string($p),mysql_real_escape_string($n)); $result=mysql_query...

sanitation script in php for login credentials...

What I am looking for currently is a simple, basic, login credentials sanitation script. I understand that I make a function to do so and I have one...but all it does right now is strip tags... am I doomed to use replace? or is there a way i can just remove all special characters and spaces and limit it to only letters and numbers...th...

How do I turn a PDF email attachment to an image (jpg) in a PHP page?

Hi guys. Long time viewer, first time question asker. I'm trying to have my personal website parse through my mail box for attachments from a certain subscription list, and then be able to view the PDF attachments as images, preferably jpg. With the help of this: http://www.linuxscope.net/articles/mailAttachmentsPHP.html I'm currently...

My Pop window displays Horizontal scroller, how to remove it?

My Pop window displays Horizontal scroller, how to remove it? I am using Mozilla 3.6.3, PHP in Windows, I have an anchor tag with href as given below: <a href="javascript:popupWindow('http://example/english/images/buttons/button_invoice.gif"&gt;&lt;/a&gt; but when I click on this link my pop window is displayed with a horizontal scro...

PHP while(variable=mysql_fetch_assoc) - explanation

Hi, I have been working with C# so this is quite strange for me: while($variable=mysql_fetch_assoc) { $X=$variable['A']; $Y=$variable['B']; } If it is like an ordinary loop, then X,Y will be reset with every loop, right? I have not been able to look up in PHP manual how it works. I guess that in each loop it advances to ...