php

PHP/MySQL how to insert and or update two MySQL tables?

I was wondering how can I update my two database tables using PHP and MySQL? I want to add a second table called tags_2 that will check if a tag already exists and if it does add it to the current count in the table and if the tag does not exist add it to the table. I hope I explained it right? I basically need help in adding the corre...

Questions about PHP and Java

I want to know how Java (JSP) on Tomcat compares to PHP on Apache in terms of performance. Two servers with the same hardware configurations, one running Tomcat/Java (JSP) the other Apache/PHP, both servers maxed out with how many connections they can handle at once. Would they be somewhat close or would one pull away from the other one...

removing items from url strings in PHP

Hi guys! I would appreciate some help here: What I want to do: remove &itemsperpage=10 from: http://localhost/thi/search/filter.html?type=featured&amp;page=2&amp;itemsperpage=10 and create a link from it: http://localhost/thi/search/filter.html?type=featured&amp;page=2&amp;itemsperpage=15 here's what I have come up with so far: <...

How to generate random password with PHP?

Or is there a software to auto generate random passwords? ...

"exec() has been disabled for security reasons" & "Undefined variable"

I found a cool MySQL backup script. It's working fine on some hosting companies. Now I'm trying it on a different host running PHP Version 5.2.8. I have a php.ini file that contains this (in both root dir and current dir): disable_functions =. I'm getting these warnings, and it seems like they are more than warnings. If the exec(...

Sending data along with a redirect in CodeIgniter

I have a simple C (of CRUD) function, and I'd like to send a message (error or success) along with my redirect from the "insert" function I have written up. Is there a way to adhere a POST field with a redirect? In pseudo code I have: function view_all{ //set up some initial variables $this->load->view(viewing_page, $data) } f...

send php variables to php file using jquery ajax?

i want to send a php variable $thread_id to php file using jquery ajax, so the php file can get all posts for $thread_id and echo it back to main file. it doesnt work when i type: $.get("ajaxcall_reply.php", thread_id: $thread_id, function(data) { $("#threads").html(data); }); how should i type? ...

How do I $.post an array with jQuery so I can use the array in my PHP file?

I have the following piece of jQuery code: function saveSchedule() { var events = []; $('ul#schedule-list').children().each(function() { events.push($(this).attr('value')); }); jQuery.each(events, function() { alert(this); }); $.post("schedule_servic...

Pass variable from image to next page

Hey I have dynamic image begin created with imagecreate(), and I have random values being produced, and I want to pass that random number, to a variable, and use that variable inside the page where Im using the image source. The image is on random.php, and Im using <img src="random.php" /> on page index.php if that matters, and I want ...

php editing xml element

This is part of the XML I want to edit <ScrapBook> <Event> <Name> Name of Event <Name> <Other Elements> </Event> <ScrapBook> I need to modify the Name of the Event. I am able to delete the node using remove_child. But I dont know how to add another element at the same spot. This is my code: public function editEventNam...

Parsing HTML with Php

I cant get the data between the tags into the arrays: // Load the HTML string from file and create a SimpleXMLElement $html_string = file_get_contents("data/csr.html"); /*the string really is in $html_string*/ $root = new SimpleXMLElement($html_string); Problem starts here when I try to get that the value between the tags: div, h2 and...

How to make a subdomain + files on it, acessible to people with special privileges?

Im adding a premium section to my site which already has free registration. People who will pay a monthly fee will have access to content (html, images and media files) that will be hosted on a subdomain lets say..... content1.domain.com How would I make it so files that are delivered via that subdomain, cannot be hotlinked or copied, u...

Session Help: is it my fault?

Hello. I have some (crappy) software that nevertheless works on all the installs I've done except this new one. The problem seems to be that session variables are not being set, or that every time session_start is getting called it destroys the old session, even though I am using cookies. Looking at php.net's info on sessions, I came ac...

Getting Objective-C Objects in PHP

Hi all, I am sending an NSData Object to the server script running PHP.Is it possible to collect that object in PHP ? Is it possible to get NSArray,NSString, NSData or any Custom Objects (Subclass of NSObject) in PHP ? Thanks ...

Only update the MYSQL field if the field contains null or 0.

I want to insert data into a table, then if the table already has that same input value of rName then it is to update this row (as rName is a unique index) which it all does well. But on the UPDATE I would like it to only UPDATE the fields IF the field doesn’t already have something in it (NULL). INSERT INTO $table (`rDate`, `rName`,...

Login, logout and duration time in php and mysql?

I would like to store the login, logout and duration time in database. The login time is created when the user is authenticated(successfully logged in) The logout time is created when the user clicks the logout button The duration is logout - login time. (logout minus login) But the problem is, what if the user didnt click the logo...

approach for "site down for maintenance"

I have been using Joomla and I love its administrative facility to put the site down for maintenance. As I have seen, all requests to the site if it is in maintenance mode is routed to a single page. If I want to add my own "site down for maintenance" module for a non-Joomla site, how do I do this? I am using an MVC framework in PHP call...

html email problem with posted php variable

Hi I am working to send email with the html body. Body html is posted by php variable with ajax. but all html will be ignored. for example in email.php HTML element <textarea id="html" cols="20" name="TextArea1" rows="2">HTML code is here</textarea> Javascript var html = $("#html").val(); $.post("function.php", { html: html }, fu...

Submit Value With Javascript

Hi All, Im a little stuck with the following function. Please note, Im a total noob with javascript/ajax, so please bare with me: <script type="text/javascript"> function removeElement($parentDiv, $childDiv){ if (document.getElementById($childDiv)) { var child = document.getElementById($childDiv); var par...

Please suggest a good book on Drupal

Can somebody please suggest a comprehensive book on Drupal? It would be great if the book is available online (and free :) ) ...