Search found 26 matches

by ravi951
Fri Sep 23, 2011 5:07 am
Forum: PHP coding => General
Topic: regarding php session
Replies: 1
Views: 541

regarding php session

tell me how to do
1)check session is present or not
2)until there is a session then it must redirect to page "products.php"
3)if there is no session also create one session and then redirect to the
page "products.php"
by ravi951
Thu Sep 22, 2011 5:45 am
Forum: PHP coding => General
Topic: assigning a session to user
Replies: 3
Views: 645

Re: assigning a session to user

i need to redirect the page to "products.php" tell me how to do in the below code...... <?php session_start(); mysql_connect("localhost","root","") or die("mysql_error()"); mysql_select_db("shopping") or die("mysql_error()"); if(isset($_SESSION['username'])) { $time = time(); print "Your SessionID: ...
by ravi951
Thu Sep 22, 2011 1:38 am
Forum: PHP coding => General
Topic: assigning a session to user
Replies: 3
Views: 645

assigning a session to user

hi all, i have written a code in php that will check whether the session exists or not and it will generate the session id. below is the code..... [PHP] <?php session_start(); mysql_connect("localhost","root","") or die("mysql_error()"); mysql_select_db("shopping") or die("mysql_error()"); if(!isset...
by ravi951
Wed Sep 21, 2011 7:53 pm
Forum: PHP coding => General
Topic: checking for sessions
Replies: 7
Views: 1299

Re: checking for sessions

hi all.
i want the above code to be modified as the following.......
i want to check whether session exists or not.
if not exists then create the new session by using ran() or time().
else then continue with the present session.
tell me how to do it.....
by ravi951
Wed Sep 21, 2011 6:13 am
Forum: PHP coding => General
Topic: checking for sessions
Replies: 7
Views: 1299

Re: checking for sessions

how to modify in that code which i posted above/......
by ravi951
Wed Sep 21, 2011 4:24 am
Forum: PHP coding => General
Topic: checking for sessions
Replies: 7
Views: 1299

Re: checking for sessions

can u explain briefly how to do it....
by ravi951
Wed Sep 21, 2011 1:30 am
Forum: PHP coding => General
Topic: checking for sessions
Replies: 7
Views: 1299

checking for sessions

hi all, i have written a code for checking whether there is a session or not. if not it has to be replaced with the time() value. but it is displaying the error as Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\shopping1\session.php:9) in C:\xa...
by ravi951
Tue Sep 20, 2011 9:15 pm
Forum: PHP coding => General
Topic: parse error in php
Replies: 1
Views: 601

parse error in php

hi all, i have written a code using php for sessions.it will checks whether the user is new or already registered... i am getting the error as Parse error: syntax error, unexpected T_ELSE in C:\xampp\htdocs\shopping1\task.php on line 16 kindly tell me what went wrong. below is the code...... <?php d...
by ravi951
Mon Sep 19, 2011 11:01 pm
Forum: PHP coding => General
Topic: login using time or sessionid
Replies: 0
Views: 467

login using time or sessionid

hi all, i have written a code in php using sessions.below is the code...... <?php if(!isset($_SESSION)) { session_start(); } $now = time(); $limit = $now; if(isset($_SESSION['last_activity']) && ($_SESSION['last_activity'] < $limit)) { $_SESSION = array(); header('Location:logout.php'); exit; } else...
by ravi951
Sat Jul 16, 2011 4:05 am
Forum: PHP coding => General
Topic: simple form using javascript and php
Replies: 2
Views: 670

simple form using javascript and php

Hi all, i want to create a simple form with 5 fields name,email id,password,retype password and phone number.I have written code in javascript now tell me how to do next step. below i have written functions for every one..... i am confused how to do next..... <html> <head> <SCRIPT LANGUAGE="JavaScri...
by ravi951
Tue Jul 12, 2011 9:17 pm
Forum: PHP coding => General
Topic: XML error
Replies: 0
Views: 375

XML error

Hi all, I am going to create an xml using php.I need to display the structure i created in php.I have saved this file name as myfile.php but i am getting an error as Fatal error: Call to a member function createElement() on a non-object in C:\xampp\htdocs\myfile.php on line 3 This is a simple one an...
by ravi951
Tue Jul 12, 2011 8:42 pm
Forum: PHP coding => General
Topic: changing file name
Replies: 5
Views: 1017

Re: changing file name

At last i done it..Below is the perfect code for savind same pdf's any no of time using random number <?php if(isset($_POST['uploaded'])) { if($_FILES['file']['type']=="application/pdf") { if($_POST[upload] =="1") { function findexts($filename) { $filename = stripslashes($_FILES['file']['name']); $e...
by ravi951
Tue Jul 12, 2011 2:32 am
Forum: PHP coding => General
Topic: Increasing memory limit
Replies: 1
Views: 666

Increasing memory limit

Hi all,
I need to change the memory limit in the php.ini file having 8m default to 16 m
with out changing in the php.ini configuration setting.
Can u tell me how to do it?
by ravi951
Mon Jul 11, 2011 7:36 pm
Forum: PHP coding => General
Topic: changing file name
Replies: 5
Views: 1017

Re: changing file name

below is the code i written.i have generated random no.using that random number i have to assign to the file name for pdf. <?php if(isset($_POST['uploaded'])) { if($_FILES['file']['type']=="application/pdf") { if($_POST[upload] =="1") { function findexts($filename) { $filename = strtolower($filename...
by ravi951
Mon Jul 11, 2011 1:12 am
Forum: PHP coding => General
Topic: explode function
Replies: 2
Views: 677

Re: explode function

hi tell me where to paste this one...i need to save the file name with random number.extension where extension is pdf only
by ravi951
Mon Jul 11, 2011 12:22 am
Forum: PHP coding => General
Topic: explode function
Replies: 2
Views: 677

explode function

Hi all, i am uploading the file to uploads folder.i am uploading only pdf's.if i insert the same pdf then using random no as file name it should save as many times i upload the same pdf. i want to split the file name i uploaded using explode function.i want to compare with the same pdf which i uploa...
by ravi951
Sun Jul 10, 2011 9:32 pm
Forum: PHP coding => General
Topic: saving file name with random number
Replies: 2
Views: 570

saving file name with random number

hi all,
I want to save the file name with random no which i have generated.Can u tell me how to save random number as a file name.......
by ravi951
Sun Jul 10, 2011 8:57 pm
Forum: PHP coding => General
Topic: changing file name
Replies: 5
Views: 1017

changing file name

Hi all, I am uploading pdf's to folders.I have done almost.But my task is to rename the same pdf by some random number and store in the folder.I have created random number it is displaying the number.but i want that random number value as my file name every time i upload. Kindly give me the code.......
by ravi951
Sat Jul 09, 2011 1:21 am
Forum: PHP coding => General
Topic: uploading pdf's only
Replies: 11
Views: 4070

Re: uploading pdf's only

dude i got it...we need to check with isset function.....below is the code working perfectly <?php if(isset($_POST['upload'])){ if($_FILES['file']['type']=="application/pdf") { if($_POST[upload] =="1") { $to="uploads/".$_FILES['file']['name']; move_uploaded_file($_FILES['file']['tmp_name'],$to); ech...
by ravi951
Sat Jul 09, 2011 12:58 am
Forum: PHP coding => General
Topic: uploading pdf's only
Replies: 11
Views: 4070

Re: uploading pdf's only

no dude it is not working...check once.........
It is displaying message "it is not pdf" before we are trying to upload
by ravi951
Sat Jul 09, 2011 12:34 am
Forum: PHP coding => General
Topic: uploading pdf's only
Replies: 11
Views: 4070

Re: uploading pdf's only

hi dude the other files r not uploading but it is not displaying the message"it is not a pdf file".
i have given echo message.
It should display me the message other than pdf's if we are trying to upload.
by ravi951
Fri Jul 08, 2011 11:29 pm
Forum: Your Scripts
Topic: uploading only pdf's
Replies: 2
Views: 1485

uploading only pdf's

Hi all, i want a php program to upload only pdf files other files it should not take.i have tried below code but it is accepting all files.. <?php if($_FILES['file']['type']="application/pdf") { if($_POST[upload] =="1") { $to="uploads/".$_FILES['file']['name']; move_uploaded_file($_FILES['file']['tm...
by ravi951
Fri Jul 08, 2011 10:36 pm
Forum: PHP coding => General
Topic: uploading pdf's only
Replies: 11
Views: 4070

uploading pdf's only

HI all, I need php code to upload only pdf files.Other than pdf it should reject .I have done in this way but it is not executing.It is uploading all type of files. <?php if($_FILES['file']['type']="application/pdf") { if($_POST[upload] =="1") { $to="uploads/".$_FILES['file']['name']; move_uploaded_...
by ravi951
Fri Jul 08, 2011 5:25 am
Forum: PHP coding => General
Topic: how to upload file using localhost
Replies: 2
Views: 665

how to upload file using localhost

Hi all, I am new to php.I have problem for uploading file.my problem is... I need to upload a same file so that it should automatically upload the file with out over riding it. I think it should be done using time function.i have uploaded file like C:\Documents and Settings\dcs456\Desktop\upload_fil...
by ravi951
Fri Jul 08, 2011 5:24 am
Forum: PHP coding => General
Topic: to upload file
Replies: 0
Views: 489

to upload file

Hi all, I am new to php.I have problem for uploading file.my problem is... I need to upload a same file so that it should automatically upload the file with out over riding it. I think it should be done using time function.i have uploaded file like C:\Documents and Settings\dcs456\Desktop\upload_fil...