Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Aneeb

Pages: [1] 2
1
General PHP Help / How to get data from a specific path
« on: October 12, 2012, 09:36:33 PM »
Hey everyone! i am trying to fetch data from different file locations, every time there is a new location like this

/5/3/539238_375049019231475_1212083119_n.jpg
/3/0/309320_396625203733616_1897402511_n.jpg
/n/i/nike.jpg

I want to get data from all these locations, how do i get it? Please help me..

2
General PHP Help / fetching data from multiple tables
« on: October 08, 2012, 03:22:45 PM »
Hey everyone! i am trying to fetch data from multiple tables, but my code is displaying the data of only one table. I don't know why it is showing data of single table..

here is my code

PHP Code: [Select]

<?php
$localhost
="localhost";
$dbuser="root";
$dbpass="";
$dbname="shoppro";
$connect=mysql_connect($localhost,$dbuser,$dbpass);
if ( !
$connect )
{
echo 
"Error connecting to database.\n";
}
mysql_select_db("$dbname",$connect);
$count "select count(*)-1 from core_store_group";
$sql '';
for(
$i=0;$i<2;$i++){
$sql="select name,price,short_description,sku,weight,promotion from catalog_product_flat_".$i;
$result=mysql_query($sql);
}
while(
$row=mysql_fetch_array($result)){
	
echo 
$row['name'];
	
echo 
"<br>";
	
}
?>


Please help me !!

3
General PHP Help / Re: SESSION variables are not working properly
« on: August 28, 2012, 01:25:27 PM »
Thanks Dex2908, really appreciate your answer.

4
General PHP Help / SESSION variables are not working properly
« on: August 28, 2012, 08:03:23 AM »
Hey Everyone! i am having a problem in my website, the session variables are working properly on local server, but not on live server. I am doing it like this
PHP Code: [Select]

session_start
();
$_SESSION['pin'] = $pin;


and i am calling it like this.
PHP Code: [Select]

session_start
();
 
$pin $_SESSION['pin']; 
echo 
$pin;


pleae help me i am new to this..

5
General PHP Help / Undefined Index error
« on: August 28, 2012, 06:10:45 AM »
Hey everyone! i am working on a website, i am having a problem in it. I am saving pin of the user in session and i am calling that pin in the main page, when i called it it gets an error of
Notice: Undefined index: PIN in D:\wamp\www\mano\membersweb.php on line 81
Call Stack #timememoryfunctionlocation 10.0007383464 {main}()



here i am putting the pin in session
PHP Code: [Select]

<?php 
session_start
();
include
"config.php";

$username=$_REQUEST['uname'];
$password=$_REQUEST['pass'];
 
$pin "";

$sql="SELECT id,pin
FROM userinfo u
WHERE  uname='
$username' AND pass='$password' ";
echo 
$sql;
 
$result=mysql_query($sql);
while(
$entity=mysql_fetch_assoc($result)){
 
$pin $entity['pin'];
 
$_SESSION['id'] = $entity['id'];
}

$_SESSION['pin'] = $pin;
header("location:mlogprocess.php?pin=".$pin);
 
?>


and here i am calling it
Code: [Select]
<div id="topnav">
      <ul>
        <li class="active"><a href="index.html">Home</a></li>
        <li><a href="about.html">About</a></li>
        <li>
        </li>
        <li ><a href="services.html">Services</a></li>
<li ><a href="membersweb.php?pin=<?php session_start(); $pin $_SESSION['pin']; echo $pin?> ">Profile</a></li>
       
      </ul>
    </div>

6
General PHP Help / How to take image as an input
« on: July 11, 2012, 01:54:05 PM »
Hey everyone! i am creating a form in which i want to take image as an input and save it in the database. I want to save the image name in the database and the image file in a particular folder.

How can i do it plz help me..

promo.php
PHP Code: [Select]
<!DOCTYPE html >
<
html>
<
head>
<
meta charset="utf-8" />

<
title>RegistrationForm</title>
<
meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
</
head>

<
body>
<
div id="content">
<!--
begin form-->
<
div class="form-content">
<
form action="promotion.php" method="post" class="promofrom">

<
fieldset>
<
div class="username">
<
label for="username"><span class="style1">Username</span></label>
<
input type="text" id="username" name="uname"required="required" placeholder="Enter Username"/>
</
div>


<
div class="image">
<
p
              <
br> <label for="image"><span class="style1">Enter Image</span></label><br
            <
input type="file" name="image"/> </br></br>
            </
p>
            </
div>
<
div class="submitbutton">
<
button name="submit" value="Register" type="submit" class="style2">REGISTER</button>
</
div>



</
fieldset>


</
form>
<!--
End Form-->
</
div>
</
div>
</
body>
</
html>




promotion.php

PHP Code: [Select]

<?php include "config.php";
session_start();
$username=$_POST['uname'];
$image=$_POST['image'];

$insert="INSERT into promotion(username,image) VALUES('".$userno."','".$image."')"
if (
mysql_query($insert)){
echo 
"added";
}
else
echo 
"Error";
?>

7
General PHP Help / How put Notifications in website
« on: June 24, 2012, 02:00:41 PM »
Hey Everyone! i am creating a website my office and i want to put Notifications in it just like facebook, if some inserts some data or image a notification is send to all the members who uses that website. How can i do that in PHP??
Plzzz help me..

8
General PHP Help / Re: How to convert SQL query to JSON
« on: May 16, 2012, 03:32:45 PM »
Thank you ErnieAlex, your code works. But the format in which it is converting in json is slight different from the one which i wants. The json is..
{"name":{"1":"Promotion","2":"Shopping guide","3":"Supply chain"}}

and i want it like this...
{"name":{ [ "1":"Promotion","2":"Shopping guide","3":"Supply chain"} ] }

How can i get this format???

9
Beginners - Learning PHP / How to convert JSON to HTML
« on: May 14, 2012, 06:12:24 AM »
Hey everyone! i want to convert JSON into HTML. How can i do that ?? This is my the JSON

{"0":[],"name":[{"0":"35","id":"35","1":"1","entityid":"1","2":"ui","uname":"ui","3":"Promotion","display":"Promotion"}]}


Plz help me..

10
General PHP Help / Re: How to convert SQL query to JSON
« on: May 13, 2012, 04:13:16 AM »
Thank you sir for replying. I am creating a login/registration form, i am running a query in which the categories which the user selected at the time of registration are  displayed when he logs-in. Now i want to convert it in JSON and pass it to the other page. Here is the code
PHP Code: [Select]
<?php 
include"config.php";
/*$Login=$_POST['Login'];
if($Login){*/
$username=$_POST['uname'];
$password=md5($_POST['pass']);

$query2=mysql_query("SELECT ue.id,ue.entityid,u.uname,e.display
FROM userentity ue,userinfo u,entity e
WHERE ue.id = u.id
AND ue.entityid = e.id AND uname='
$username' AND pass='$password' ");
$rows[]=array();
if(
mysql_num_rows($query2)){
while(
$data2=mysql_fetch_array($query2)){
$rows['name'][]=$data2;

session_start();
$_SESSION['uname']=$data2["uname"];
foreach(
$data2["display"] as $value){
	
}
$_SESSION['valid_time'] = time();

header("location: members.php");

exit;

}
header("location: index.php");

}

 
?>

11
General PHP Help / How to convert SQL query to JSON
« on: May 12, 2012, 05:48:10 PM »
Hey everyone!! i want to convert my sql query to JSON and then pass the JSON to the other page. How can i do this ??? Plzz help me..

12
General PHP Help / How to convert PHP code into JSON
« on: May 09, 2012, 01:38:00 PM »
Hey everyone... how can i convert my php code into JSON and pass it to a new page ??
Need Help..

13
General PHP Help / Re: How to create a weak entity between two tables
« on: April 29, 2012, 11:32:25 AM »
Thank you Albert for helping us, we were stuck in this from past 10 days but can't find a perfect solution. You helped us a a lot. Thank you very much for helping us. May God Bless you.

14
General PHP Help / Re: How to create a weak entity between two tables
« on: April 27, 2012, 11:35:02 AM »
Hey Albert! thanks for replying. Can i give you my code? i am having a bit confusion with this.

15
General PHP Help / Re: How to create a weak entity between two tables
« on: April 25, 2012, 06:06:57 PM »
i have also created an image for better understanding this is the URL of the image....
http://tinypic.com/r/2evq82g/6

Pages: [1] 2