php

How can I grab information using PHP?

I need to grab the list of names and descriptions of a website for indexing purposes. How can I do this using PHP? I would think I would have to use DOM correct? ...

php / sql search

Hi, I want to find articles when searched on following keyword: "maruti sx4 maintenance costs against honda city" I want a query or php regular expression which can find a article which having below text "SX4 maintenance cost is lesser because of Maruti. Honda City maintenance is also okay." i.e i want a function/code which can fi...

simple problem in php

<?php $n1=$_POST['mont']; echo $n1; if($n1==07) echo "numeric"; if($n1=="07") echo "string"; if($n1==08) echo "numeric"; if($n1=="08") echo "string"; ?> in this if $_POST["mont"] is 07 the output is both string and integer but if $_POST["mont"] is 08 the output is only string what may be the cause ...

fullcalendar settings via ajax

Hi, I would like to pass fullcalendar settings (i.e. startTime, endTime) via ajax. I would like to have something similar to this: eventSources: [ "events.php", "settings.php" ] where events.php holds events array, settings.php holds settings array. If this approach works, how can i use settings values? If settings.php generates jso...

import text file into mysql using jquery

i want to import .txt file values into mysql using php and jquery/Ajax without page refresh. with following format. for example text file is : user@emaill;user name;gender user1@emaill;user name;gender user2@emaill;user name;gender user select file and press Process Button. once it start processing JQUERY/AJAX s...

Dynamically selecting colors using php or javascript

hi everyone, can anyone pls give sugessions on how to write the script for selecting a color in a live page so that the selected color apply to whole page.can any one pls provide me a sample scripts for dis. ...

PHP and Multiple DB Selects

I've got two tables from which I need to extract information, but the data from the second table depends on the information I get from the first one. Is there an easy way to handle this? <?php mysql_connect('localhost', 'root', 'root') or die(mysql_error()); mysql_select_db('stadium') or die(mysql_error()); $result = mysql_query(...

echo not displaying value on page

I have used "echo $query" to see whether it is getting value or not but it is not showing anything on the page. What is the other way to see what value it is getting? I use Aptana Studio 2.0 PDT but I am not able to set the breakpoints. Quite new in it. <?php error_reporting(E_ALL); ini_set('display_errors', '1'); $ulName = $_GET[...

create file with name based on what already exist in folder

i want to create a new file in a folder with existing files with names in a numerical order eg. 1, 2, 3, 4... i want to check what is the last nr and then create a file with one nr over that one. i know i should use file_exists but i don't know exactly how to use it, in a for loop maybe? but how? would be nice if someone could give me...

warning problem: expects parameter 1 to be mysqli_result

I get the following warning listed below and I was wondering how do I fix it Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given on line 65 The code is around this section of PHP code listed below. I can list the full code if needed. // function to retrieve average and votes function getRatingText(){ ...

How do you join (implode) a MySQL Array?

The implode() function works on normal arrays, but it doesn't work on arrays created with mysql_fetch_array (I also tried mysql_fetch_row) How do you get them to work? Defined Above: $friends = mysql_query("SELECT * FROM friend WHERE u1='$userinfo[username]' OR u2='$userinfo[username]' "); And further down: $friendsrow = mysql_f...

Is it safe to use proxies?

hi! i'm using php curl's proxy feature to sign in to a site. I wanna know whether this is safe or not. Can the proxy site "hack" my usename and password? I don't, actually can't, encrypt my password before sending it to the proxy server. EDIT: The scenario is like this: I'm trying to scrape data from a members-only page. I sign-in wit...

error when passing rss feed to php domDocument object

Hello, can anyone possibly point me in the right direction I am using curl to get back a google picasa api feed. This all works well, with the autorisation and the fetching of the data, but now I want to expand a little bit in try'n to add,update tags,pics, geo-info from my site. How can I pass the feed I got back with curl to the dom...

file import security issue

i have one question when we give option to web user to import data into mysql table, is this secure? for example <form method="post" action="import.php" enctype="multipart/form-data"> <input id="file1" name="file1" type="file"> <input type="submit" name="button" id="button" value="Submit" > </form> and in import.php ...

MySQL & PHP - Not unique table/alias

I get the following error listed below and was wondering how do I fix this problem. Not unique table/alias: 'grades' Here is the code I think is giving me the problem. function getRating(){ $dbc = mysqli_connect ("localhost", "root", "", "sitename"); $page = '3'; $sql1 = "SELECT COUNT(*) FROM articles_grades WHE...

Posting screen width using jQuery

Using this code var sw = window.screen.width; $.post("http://www.example.com/track.php", {result: sw }, "html"); and $_SERVER['result']; in the server I'm trying to get the sreen width but it does not work. It is something wrong with the "result". I'm new in Javascript and jQuery... http://api.jquery.com/jQuery.post/ ...

PHP Access sub property by name at runtime

Hello! Is it possible to access a sub-property of an object dynamically? I managed it to access the properties of an object, but not the properties of a sub-object. Here is an example of the things I want to do: class SubTest { public $age; public function __construct($age) { $this->age = $age; } } class Test...

PHP & mySQL: When exactly to use htmlentities?

Hi all, PLATFORM: PHP & mySQL For my experimentation purposes, I have tried out few of the XSS injections myself on my own website. Consider this situation where I have my form textarea input. As this is a textarea, I am able to enter text and all sorts of (English) characters. Here are my observations: A). If I apply only strip_tags ...

PHP - Fatal error: Unsupported operand types

I Keep getting the following error and I was wondering on how to fix it. Fatal error: Unsupported operand types on line 97 Its around this area of code listed below. I can list the full code if needed. PHP code $total_rating_points = mysqli_fetch_array($result); if (!empty($total_rating_points) && !empty($total_ratings)){ $avg ...

Poll system multiple answers

If you would want to make a poll system that supports multiple answers (options) (not just yes/no) how would you do it? How would you structure the db etc? I don't want to limit the answers/options. Some input on this would be greatly appreciated. ...