Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more

Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Web Programming > PHP Development
User Name
Password

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 10-03-2006, 01:40 PM   #1 (permalink)
BrotherBear
Member
 
Join Date: Jun 2006
Posts: 108
Default My last question about PHP

hi all



the only thing I need to know now to start tests and all of that is to know can I put all PHP scripts together in the html document or I have to make different files for html and PHP and if it's better to make them separately how can I do that?

and what's better to use the user_level funtion or the "Class" or "access"?

thanks!!!!

BB
__________________
http://bbanddisney.freeprohost.com/

We Changed the Address, Fresh News From Disney and my Career
BrotherBear is offline   Reply With Quote
Sponsored Links
Old 10-03-2006, 07:55 PM   #2 (permalink)
O~Snapple
Moderator Of The Year
 
O~Snapple's Avatar
 
Join Date: Jul 2006
Location: Cali Breeze
Posts: 716
Send a message via MSN to O~Snapple Send a message via Skype™ to O~Snapple
Default Re: My last question about PHP

BB What’s Crackin my friend,

First Question I would keep them separate, and if you need them to run together use the Include statement at the beginning of the Script. This way each script is each script. you may have a config.php and a access database.php so in the access.php add the Include command to the top and it should work like a dream.

2nd question, its really user preference, use what one your script is configured for. and i would suggest sticking to using only one so there is no confusion at the end.

Good Luck

~Snapple
__________________
The Real Truth
Epademik Emcee Esq. New Album The 3rd Finger is in Stores Now!
Snap Marketing Management and Consulting
O~Snapple is offline   Reply With Quote
Old 10-04-2006, 02:50 PM   #3 (permalink)
BrotherBear
Member
 
Join Date: Jun 2006
Posts: 108
Default Re: My last question about PHP

thanks my friend !!!
I'm just here trying to figure this stuff out

so it works like this I make one file with only php script and with an extension PHP then in my html file at the top I put the include (file.php) right?

BB
__________________
http://bbanddisney.freeprohost.com/

We Changed the Address, Fresh News From Disney and my Career

Last edited by BrotherBear : 10-04-2006 at 03:51 PM.
BrotherBear is offline   Reply With Quote
Old 10-05-2006, 12:00 PM   #4 (permalink)
O~Snapple
Moderator Of The Year
 
O~Snapple's Avatar
 
Join Date: Jul 2006
Location: Cali Breeze
Posts: 716
Send a message via MSN to O~Snapple Send a message via Skype™ to O~Snapple
Default Re: My last question about PHP

Well yes and no,

make one PHP script per Action. As in database.php ( for going to the database) config.php (for the configuration of the site) action.php ( for actions that will need to be performed) and so on and so on.

I would personally get rid of the .HTML all togeather. KISS it Keep It Simple Stupid. Because a PHP script wont Run if the Extension is .HTML and include is a php string. IE
PHP Code:
<?php
include ('your File Here');
?>
would be at the top of the page, you can include several files, like the config.php, setup.php etc...

What helped me learn about all of this is i downloaded a huge script from Free PHP scripts to download from PHPJunkYard.com and just looked at it started at the Index.php or .html and saw what was included, went to that script and saw what it did, and so on and so on.


~Snapple
__________________
The Real Truth
Epademik Emcee Esq. New Album The 3rd Finger is in Stores Now!
Snap Marketing Management and Consulting
O~Snapple is offline   Reply With Quote
Old 10-05-2006, 01:40 PM   #5 (permalink)
BrotherBear
Member
 
Join Date: Jun 2006
Posts: 108
Default Re: My last question about PHP

well I made a test yesterday and well I made a file called thankyou.php with the connection to the database and made a simple form when I click the button it goes to the thankyou.php file but it tells me that the connection failed cos access was denied what can I do? what info exactly should I put in the mysql_connect ?

BB
__________________
http://bbanddisney.freeprohost.com/

We Changed the Address, Fresh News From Disney and my Career
BrotherBear is offline   Reply With Quote
Old 10-05-2006, 11:36 PM   #6 (permalink)
O~Snapple
Moderator Of The Year
 
O~Snapple's Avatar
 
Join Date: Jul 2006
Location: Cali Breeze
Posts: 716
Send a message via MSN to O~Snapple Send a message via Skype™ to O~Snapple
Default Re: My last question about PHP

Well This sounds like a php problem can you post some of teh code so i can have a look???


~Snapple
__________________
The Real Truth
Epademik Emcee Esq. New Album The 3rd Finger is in Stores Now!
Snap Marketing Management and Consulting
O~Snapple is offline   Reply With Quote
Old 10-06-2006, 03:47 PM   #7 (permalink)
BrotherBear
Member
 
Join Date: Jun 2006
Posts: 108
Default Re: My last question about PHP

here's the code but actually I have solved this problem here's the RIGHT code

PHP Code:
<?php

$con 
mysql_connect("mysql1.100ws.com","johncoda_downloa","PASSWORD");
if (!
$con)
  {
  die(
'Could not connect: ' mysql_error());
  }

?>

listen I have an html file that has a form inputs and a submit button that sends you to thankyou.php now in thankyou.php what do I have to put to handle and store that information?

and thanks my friend for all the help

BB
__________________
http://bbanddisney.freeprohost.com/

We Changed the Address, Fresh News From Disney and my Career
BrotherBear is offline   Reply With Quote
Old 10-07-2006, 05:09 AM   #8 (permalink)
O~Snapple
Moderator Of The Year
 
O~Snapple's Avatar
 
Join Date: Jul 2006
Location: Cali Breeze
Posts: 716
Send a message via MSN to O~Snapple Send a message via Skype™ to O~Snapple
Default Re: My last question about PHP

Nothing LOL that is the great part... Going back to teh Action of the form that is what connects to the database and adds the information to the database. In the action.php you will have a statment like:

If connection works and information is in the database go to Thankyou.php

Else, GO to error.php

That is not the script but you get the idea of whats going on.

But i hate to burst your bubble but after this is set its really not complete, because there are so many security issues with a simple script any one can put a malicious string into one of the form boxes and submit it to teh database that would be no good

~Snapple
__________________
The Real Truth
Epademik Emcee Esq. New Album The 3rd Finger is in Stores Now!
Snap Marketing Management and Consulting
O~Snapple is offline   Reply With Quote
Old 10-07-2006, 06:45 PM   #9 (permalink)
BrotherBear
Member
 
Join Date: Jun 2006
Posts: 108
Default Re: My last question about PHP

hey snapple!!!!

I would like you to see the code of the form and the code of the next page when they press submit so you can tell me if it is right

form page
Code:
<html> <head> <META name='description' content='disney news,disneyreleases, disneyevents, disney forums, disney, brother bear'> <META name='KEYWORDS' content='disney, official site of john coda, pagina oficial, disney forums, brother bear, tierra de osos, phil collins'> <META name='author' content='All content protected by DIG (Disney Internet Groups) and John Coda 2006'> <style type='text/css'> body {background:url('fondo_1.png') no-repeat fixed; margin:0 0 50px 0; padding:0; border:0; } a:link {color:white; text-decoration:none;} a:visited {color:white; text-decoration:none;} a:hover {color:DarkBlue; text-decoration:underline;} a:active {color:DarkBlue; text-decoration:none;} .container { width:700px; height:320px; margin:0; padding:0 60 0 0; background-color:DarkBlue; border:0; } .menu { width:198px; height:330px; margin:0; padding:0; border:0; float:left; } .contact { width:400px; height:40px; margin:0; padding:4; border:1px solid LightSkyBlue; background-color:RoyalBlue; font-family:monotype corsiva; font-size:25px; text-align:center; color:white; float:right; } .text { width:400px; height:200px; margin:0; padding:4; border:0; font-family:verdana; font-size:11px; text-align:center; color:white; float:right; } .copyright { width:700px; height:50px; margin:0; padding:2; border:0; background-color:RoyalBlue; font-family:verdana; font-size:10px; text-align:center; color:white; } </style> <title>Contact Us</title> </head> <body background='fondo_1.png'> <!--BEGINING OF BANNERS PLACE--> <table><table border='0' cellspacing='0' cellpadding='0' bgcolor='black' width='700' height='10' align='center'> <tr> <td width='150' height='10' align='center' style='font-family:Verdana;font-size:12;color:white'><b>Brother Bear And</b> <td width='800' height='10' align='left' alt='Disney Online'><img src='disneylogo.gif'> <tr> </table> <table><table border='0' cellspacing='0' cellpadding='0' bgcolor='black' width='700' height='10' align='center'> <tr> <td><a href='index.html'> <img border='0' src='Disneylogo.jpg' width='250' height='70' alt='Brother Bear And Disney'></a> <td><a href='http://www.disneyvideos.com/'> <img border='0' src='scampbanner.jpg' width='450' height='70' alt='Lady and the Tramp II: Scapms Adventure'></a> </tr> </table><!-- END OF BANNERS AND LOGO --> <!-- START OF MAIN NAV --> <center><div class='container'> <div class='menu'><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id=Menu width=198 height=330 codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,65,0"> <param name="movie" value="Menu.swf" /> <param name="quality" value="high" /> <param name="play" value="true" /> <param name="loop" value="true" /> <param name="bgcolor" value="#31309c" /> <embed src="Menu.swf" width=198 height=330 bgcolor="#31309c" quality="high" loop="true" type="application/x-shockwave-flash" pluginspace="http://www.macromedia.com/go/getflashplayer" /> </object></div> <div class='contact'>Contact Us</div> <br> <br> <br> <div class='text'>Just fill this form to contact us and we'll asnwer you as soon as possible, if you don't feel confortable contacting us like this send us an email to disneywebmaster@hotmail.com Thank You.(Fields with * are required) PLEASE DO NOT USE THIS FORM YET WE ARE STILL WORKING TO SOLVE SOME SERVER ISSUES. <br> <form action='thankyou.php' method='post'> *Name: <input type='text' name='Name' /><br> *Age: <input type='text' name='Age' /><br> *Email: <input type='text' name='Email' /><br> *Comments: <textarea name='Comments'></textarea> <br> <input type='submit' value='Submit Comment' /> </form> </div> </div></center> <br> <br> <br> <center><div class='copyright'>&#169Disney All Rights Reserved<br> This site is non-related to <b>The Walt Disney Co.</b> or any affiliated Company<br> This site contains <b>Exclusive Material</b> and cannot be used without permission<br> &#169John Coda 2006 All Rights Reserved <a href='termsofuse.html'>Terms Of Use</a> </div> </body> </html>

thankyou.php
PHP Code:
<?php

$con 
mysql_connect("mysql1.100ws.com","johncoda_downloa","PASSWORD");
if (!
$con)
  {
  die(
'Could not connect: ' mysql_error());
  }


?>
<html>
<head>

<META name='description' content='disney news,disneyreleases, disneyevents, disney forums, disney, brother bear'>
<META name='KEYWORDS' content='disney, official site of john coda, pagina oficial, disney forums, brother bear, tierra de osos, phil collins'>
<META name='author' content='All content protected by DIG (Disney Internet Groups) and John Coda 2006'>

<style type='text/css'>
body
      {background:url('fondo_1.png') no-repeat fixed;
        margin:0 0 50px 0; padding:0; border:0;
    }
          a:link {color:white; text-decoration:none;}
          a:visited {color:white; text-decoration:none;}
          a:hover {color:DarkBlue; text-decoration:underline;}
          a:active {color:DarkBlue; text-decoration:none;}

.container
      {
  width:700px; height:320px; margin:0; padding:0 60 0 0; background-color:DarkBlue; border:0;
   }
.menu
      {
   width:198px; height:330px; margin:0; padding:0; border:0; float:left;
     }
.contact
       {
   width:400px; height:40px; margin:0; padding:4; border:1px solid LightSkyBlue; background-color:RoyalBlue; font-family:monotype corsiva; font-size:25px; text-align:center; color:white; float:right;
     }
.text
{
   width:400px; height:200px; margin:0; padding:4; border:0; font-family:verdana; font-size:11px; text-align:center; color:white; float:right;
}
.copyright
      {
   width:700px; height:50px; margin:0; padding:2; border:0; background-color:RoyalBlue; font-family:verdana; font-size:10px; text-align:center; color:white;
     }
</style>
<title>Contact Us</title>
</head>
<body background='fondo_1.png'>
<!--BEGINING OF BANNERS PLACE-->

<table><table border='0' cellspacing='0' cellpadding='0' bgcolor='black' width='700' height='10' align='center'>
<tr>
<td width='150' height='10' align='center' style='font-family:Verdana;font-size:12;color:white'><b>Brother Bear And</b>
<td width='800' height='10' align='left' alt='Disney Online'><img src='disneylogo.gif'>
<tr>
</table>
<table><table border='0' cellspacing='0' cellpadding='0' bgcolor='black' width='700' height='10' align='center'>
<tr>
<td><a href='index.html'>
<img border='0' src='Disneylogo.jpg'
width='250' height='70' alt='Brother Bear And Disney'></a>
<td><a href='http://www.disneyvideos.com/'>
<img border='0' src='scampbanner.jpg'
width='450' height='70' alt='Lady and the Tramp II: Scapms Adventure'></a>
</tr>
</table><!-- END OF BANNERS AND LOGO -->
<!-- START OF MAIN NAV -->
<center><div class='container'>
<div class='menu'><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id=Menu width=198 height=330 codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,65,0">
 <param name="movie" value="Menu.swf" />
 <param name="quality" value="high" />
 <param name="play" value="true" />
 <param name="loop" value="true" />
 <param name="bgcolor" value="#31309c" />
 <embed src="Menu.swf"  width=198 height=330 bgcolor="#31309c" quality="high" loop="true"
  type="application/x-shockwave-flash" pluginspace="http://www.macromedia.com/go/getflashplayer" />
</object></div>
<div class='contact'>Contact Us</div>
<br>
<br>
<br>
<div class='text'>Thank you <?php echo $_POST["Name"]; ?>
</div>
</div></center>
<br>
<br>
<br>
<center><div class='copyright'>&#169Disney All Rights Reserved<br>
This site is non-related to <b>The Walt Disney Co.</b> or any affiliated Company<br>
This site contains <b>Exclusive Material</b> and cannot be used without permission<br>
&#169John Coda 2006 All Rights Reserved <a href='termsofuse.html'>Terms Of Use</a>
</div>
</body>
</html>

and if the data is stored how can I read/watch/access to it?

BBb
__________________
http://bbanddisney.freeprohost.com/

We Changed the Address, Fresh News From Disney and my Career
BrotherBear is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Points Per Thread View: 1.00
Points Per Thread: 11.00
Points Per Reply: 5.00



» Sponsors

» Links

» Affiliates
Web Hosting
Marketing Find
Merchant Select
SiteMap Builder
Host Compare
Dedicated Servers

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 02:02 PM.



LinkBacks Enabled by vBSEO 3.0.0 RC8
Webmaster Forums