Author Topic: PHP  (Read 7370 times)

0 Members and 1 Guest are viewing this topic.

Offline sarthak9333

  • Member
  • Sr. Member
  • *
  • Points: 30
  • Posts: 367
    • View Profile
PHP
« Reply #15 on: September 05, 2012, 04:41:31 pm »
sir... encountered a problem.
while coding...
i created 2 php files : movi and movie1 n stored dem in 1 folder.
(link of movie stored in movie1)
now wen i write localhost/foldername in d address bar... d browser asks me which php file to open.
i want that php file to open itself (without asking) in which d link to 2nd is stored.
is it possibl?
« Last Edit: September 05, 2012, 04:45:12 pm by sarthak9333 »
MaStEr oF PuPpETs...!!!! :D \\m/ \\m/

COLLEGE REPRESENTATIVE
GTBIT


Offline rudeman

  • Just live the way you want....
  • Administrator
  • Techbits Elite Member
  • *
  • Points: 725
  • Posts: 2321
  • Just live the way you want....

    • MAIT
    • _
      Not Specified
    • View Profile
    • http://www.ridely.co
PHP
« Reply #16 on: September 06, 2012, 12:53:09 am »
Name that file which contain the link as index.php

as only index.php file open up automatically , no any other file open up automatically .

Or you can use redirection .

No need to rename your file to index.php in that case .

make a file index.php and paste this code there

Code:
Only registered users can see contents. Please click here to Register or Login.

Offline sarthak9333

  • Member
  • Sr. Member
  • *
  • Points: 30
  • Posts: 367
    • View Profile
PHP
« Reply #17 on: September 11, 2012, 11:49:40 am »
Duplicate entry '1' for key 'PRIMARY'

sir... how to resolve dis error...?
MaStEr oF PuPpETs...!!!! :D \\m/ \\m/

COLLEGE REPRESENTATIVE
GTBIT


Offline Piyush

  • Member
  • Newbie
  • *
  • Points: 0
  • Posts: 10
    • View Profile
PHP
« Reply #18 on: September 11, 2012, 12:44:56 pm »
Sir(respect)  :adore1  but  it's not that only index.php can open up automatically rather it's the default setting to treat index.php/html/htm/shtml/asp/pl/cgi , default.php/html/htm/shtml/asp/pl/cgi  , home.php/html/htm/shtml/asp/pl/cgi as if a directory was requested. You can add to it other files too.

Quote from: rudeman on September 06, 2012, 12:53:09 am
Name that file which contain the link as index.php

as only index.php file open up automatically , no any other file open up automatically .

Or you can use redirection .

No need to rename your file to index.php in that case .

make a file index.php and paste this code there

Code:
Only registered users can see contents. Please click here to Register or Login.



Offline Piyush

  • Member
  • Newbie
  • *
  • Points: 0
  • Posts: 10
    • View Profile
PHP
« Reply #19 on: September 11, 2012, 12:55:37 pm »
hey sarthak as u hav just started learning php, I recommend u study http://www.yourwebskills.com/ beacuse of it's good teaching flow, u can also read http://www.w3schools.com/  it is also good.
And use http://www.php.net/ for library reference .

And dude, as Rudeman sir recommended u to use XAMPP because of zero configuration,but DO STUDY about apache configuration(httpd.conf, .htaccess) and php configuration (php.ini) ; especially apache configuration, it's very important.

Offline Piyush

  • Member
  • Newbie
  • *
  • Points: 0
  • Posts: 10
    • View Profile
PHP
« Reply #20 on: September 11, 2012, 01:00:47 pm »
Buddy,answer is in ur question only,it means that the data u r trying to enter is already in  that column and must contain unique values because of its 'primary key' attribute.

Quote from: sarthak9333 on September 11, 2012, 11:49:40 am
Duplicate entry '1' for key 'PRIMARY'

sir... how to resolve dis error...?

Offline Piyush

  • Member
  • Newbie
  • *
  • Points: 0
  • Posts: 10
    • View Profile
PHP
« Reply #21 on: September 11, 2012, 01:11:25 pm »
Sorry, forgot to tell through 'DirectoryIndex' directive in httpd.conf.
Sorry if u already knew this and didn't want to tell him coz of configuration changes.
Quote from: piyush1992 on September 11, 2012, 12:44:56 pm
Sir(respect)  :adore1  but  it's not that only index.php can open up automatically rather it's the default setting to treat index.php/html/htm/shtml/asp/pl/cgi , default.php/html/htm/shtml/asp/pl/cgi  , home.php/html/htm/shtml/asp/pl/cgi as if a directory was requested. You can add to it other files too.

Quote from: rudeman on September 06, 2012, 12:53:09 am
Name that file which contain the link as index.php

as only index.php file open up automatically , no any other file open up automatically .

Or you can use redirection .

No need to rename your file to index.php in that case .

make a file index.php and paste this code there

Code:
Only registered users can see contents. Please click here to Register or Login.



Offline sarthak9333

  • Member
  • Sr. Member
  • *
  • Points: 30
  • Posts: 367
    • View Profile
PHP
« Reply #22 on: September 12, 2012, 09:32:34 am »
sir...problem not resolved.. :( can u plz find error in dis..?

<?php
$connect=mysql_connect("localhost" , "root") or die("check your connection");
$create=mysql_query("CREATE DATABASE IF NOT EXISTS moviesite") or die(mysql_error());
mysql_select_db("moviesite");
$movie="CREATE TABLE movie
(
movie_id int(11) NOT NULL , movie_name varchar(255) NOT NULL , movie_year int(4) NOT NULL default 0,  movie_type tinyint(2) NOT NULL default 0, movie_leadactor int(11) NOT NULL default 0, movie_director int(11) NOT NULL default 0, PRIMARY KEY (movie_id),KEY movie_type(movie_type,movie_year)
)";
$results=mysql_query($movie) or die(mysql_error());
$movietype="CREATE TABLE  movietype
(
movietype_id int(11) NOT NULL auto_increment , movietype_label varchar(100) NOT NULL , PRIMARY KEY ( movietype_id)
)";
$results=mysql_query($movietype) or die(mysql_error());
$people="CREATE TABLE people
(
people_id int(11) NOT NULL auto_increment,people_fullname varchar(255) NOT NULL,people_isactor tinyint(1) NOT NULL default 0,people_isdirector tinyint(1) NOT NULL default 0,PRIMARY KEY (people_id)
)";
$results=mysql_query($people) or die(mysql_error());
echo"Movie Database successfully created!";
?>


<?php
$connect=mysql_connect("localhost", "root") or die("check your connection");
mysql_select_db("moviesite");
$insert="INSERT INTO movie (movie_id, movie_name,movie_year,movie_type,movie_leadactor,movie_director) VALUES (1,'Bruce Almighty',2003,5,1,2),(2,'office space',1999,5,5,6),(3,'Grand Canyon',1991,2,4,3)";
$results=mysql_query($insert) or die(mysql_error());
$type="INSERT INTO movietype (movietype_id,movietype_label) VALUES (1,'Sci fi'),(2,'drama'),(3,'adventure'),(4,'war'),(5,'comedy'),(6,'horror'),(7'action'),(8,'kids')";
$results=mysql_query($type) or die(mysql_error());
$people="INSERT INTO people (people_id,people_fullname,people_isactor,people_isdirector) VALUES (1,'Jim Carrey', 1, 0),  (2, 'Tom Shadyac', 0, 1), (3, 'Lawrence Kasdan', 0, 1), (4, 'Kevin Kline', 1, 0), (5, 'Ron Livingston', 1, 0), (6, 'Mike Judge', 0, 1)";
$results=mysql_query($people) or die(mysql_error());
echo"data inserted sucessfully";
?>



sir...dese are two files... d first one is creating d database ... n second one is inserting values in dat.
d error em getting is posted above dis post.
MaStEr oF PuPpETs...!!!! :D \\m/ \\m/

COLLEGE REPRESENTATIVE
GTBIT


Offline sarthak9333

  • Member
  • Sr. Member
  • *
  • Points: 30
  • Posts: 367
    • View Profile
PHP
« Reply #23 on: September 13, 2012, 09:36:33 pm »
thank u very much sir... solved d problem.
MaStEr oF PuPpETs...!!!! :D \\m/ \\m/

COLLEGE REPRESENTATIVE
GTBIT


Offline sarthak9333

  • Member
  • Sr. Member
  • *
  • Points: 30
  • Posts: 367
    • View Profile
PHP
« Reply #24 on: October 06, 2012, 12:30:05 pm »
sir....please suggest me some good IDE for PHP... fed up of doing in notepad..!! no line nos.  and many oder problems too..!  :at wits end  :at wits end
MaStEr oF PuPpETs...!!!! :D \\m/ \\m/

COLLEGE REPRESENTATIVE
GTBIT


Offline DPSC

  • Alumni
  • Techbits Elite Member
  • *
  • Points: 17108
  • Posts: 5830

    • GTBIT
    • _
      CSE
    • View Profile
    • http://mycampusnotes.com
PHP
« Reply #25 on: October 06, 2012, 12:38:11 pm »
Quote from: sarthak9333 on October 06, 2012, 12:30:05 pm
sir....please suggest me some good IDE for PHP... fed up of doing in notepad..!! no line nos.  and many oder problems too..!  :at wits end  :at wits end


use zend studios....

Offline rudeman

  • Just live the way you want....
  • Administrator
  • Techbits Elite Member
  • *
  • Points: 725
  • Posts: 2321
  • Just live the way you want....

    • MAIT
    • _
      Not Specified
    • View Profile
    • http://www.ridely.co
PHP
« Reply #26 on: October 06, 2012, 02:59:16 pm »
use php designer 8 for writing code with  speed ...

Offline sagrma

  • Administrator
  • Techbits Elite Member
  • *
  • Points: 6229
  • Posts: 5208

    • MAIT
    • _
      ECE
    • View Profile
PHP
« Reply #27 on: October 06, 2012, 09:20:34 pm »
Quote from: sarthak9333 on October 06, 2012, 12:30:05 pm
sir....please suggest me some good IDE for PHP... fed up of doing in notepad..!! no line nos.  and many oder problems too..!  :at wits end  :at wits end
USE zend it will help in future
if you go into java
eclipse is based on zend
if embedded and c
eclipse have great one for c c++
so use zend it will help in future

but if you end up in .net
well nothing is comparable to that giant

Offline Piyush

  • Member
  • Newbie
  • *
  • Points: 0
  • Posts: 10
    • View Profile
PHP
« Reply #28 on: October 07, 2012, 01:31:35 pm »
I strongly recommend u to use ECLIPSE...

Offline NIDHI33

  • Member
  • Newbie
  • *
  • Points: 21
  • Posts: 15
    • View Profile
Re: PHP
« Reply #29 on: July 31, 2013, 01:46:54 am »
Hiii ..may i get some help on how to send sms through php.... thankss :)

 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49