|
do your page start wth start_session()?
|
|
|
|
|
I have recently moved to PHP from .NET for one project.
Now i am quite familiar with the PHP syntax but the code is bit messy as am not writing it object oriented way and it's all in one page (html, mysql queries, javascript)
Now i would like to know Object Oriented way of programming in PHP so that i can make things bit neater and better and reusable.
Can we have 3 tier architecture in PHP (i guess not but still worth asking)
I was using Dream weaver for PHP which is the shittest compiler i have ever worked with. I am about to install Netbeans - what do you guys suggest - Should i look at Zend Framework for OOProgramming. Is it any good ??
Any suggestions ??
Thank You
Andyyy
|
|
|
|
|
MVC in PHP is quite usual. See http://codeigniter.com/[^] as an example of such a framework.
Dreamweaver is good for PHP, however, you could also Microsoft's Expression Web. For open source stuff, you could use the large IDE from http://www.aptana.com/[^]
Regarding PHP Object Orientation, this book is good "Beginning PHP and MySQL 5: From Novice to Professional by W. Jason Gilmore, ISBN 978-1-59059-552-7 Apress". Although this particular book is now getting a little bit old, it is still relevant.
[added]
If you are still using MS Visual Studio, there exists a (not that cheap) php plug-in http://www.jcxsoftware.com/vs.php[^] as well as a freeware MySQL dot.net connector.
modified on Monday, September 13, 2010 10:16 AM
modified 1-Aug-19 21:02pm.
|
|
|
|
|
I generally do not use OOP in PHP as I do not feel it is needed. But to make your code easier to manage you can use some of the things I do to my large projects.
Make use of includes to seperate your code into logical sections. I generally will have a main page that will post to itself for a given wensite section. The post logic is parsed at the top of the php page, and as needed will load various includes depending on the values passed. Each include can contain a form, more logic, javascript, etc...
fo eaxample I set up a typical page like this...
<?php
start_session();
include('master_includes.php');
$pg_name = 'A PAge';
pg_header($pg_name);
pg_footer('$pg_name');
?>
master_includes.php usually has a list of all the different scripts I use for the site.
A common list might be:
- db_connect.php
- header.php
- footer.php
- functions.php
- variables.php
- menu.php
I hope this helps you.
All the Best!
|
|
|
|
|
Hello all,
I am new to concept of hosting web server on external system not your PC/Laptop. on some kind of external hardware system like camera or any other hardwares which are connected to internet.
I want to host server from those system and let other connect to that server using username/password and then they should be able to change functionality of that hardware.
Thank you,
Cheers from Canada
|
|
|
|
|
is this for an intranet (used within a home or small company)? or for world-wide access?
for both, you need to estimate and provide sufficient capacity, and take care of back-up.
for the latter, you would need good up-times, and a fixed IP address. A commercial web hosting solution is recommended.
mohit`12 wrote: on some kind of external hardware system like camera or any other hardwares which are connected to internet.
is your camera running some operating system (Windows? Unix? Linux?) that supports communication protocols, file systems, scipt handling (PHP), etc?
is your camera networked?
|
|
|
|
|
thx for your reply,
Device will be connected on high-speed internet and it has to be world-wide access.
yes i don't actually care about back-up at the moment, i think device runs on some operating system so it will have ip address.
and camera was just an example. the system i am talking about is like really big system let's say when pizza delivery guy comes at your place and you pay them by debit/credit so that guy has that device which is connected world-wide and it verifies data of that card. so something similar to that. and yes system is networked and yes it will support protocols not sure about PHP.
I just posted this here because this was somewhat related because i still don't know which script i am using to host a web server.
I just need to start with basic hosting so it could be any scripting language.
Cheers from Canada,
|
|
|
|
|
That's done regularly. A classic example would be a broadband router.
What's the problem and how does it relate to PHP?
|
|
|
|
|
I wasn't sure if i will use PHP or not, i just posted here because this is somewhat related and i am new to web server hosting .
Cheers from Canada.
|
|
|
|
|
I think this is better asked in Sys Admin or Hardware and Devices forum. But in a nut shell, what you are asking for will require some research on your part. What kind of device is it and what features does it support. If the device does suport an internet connection then you then have to determine how people will access it and what will be needed to make that a reality. You may need a webserver for no other reason than it provide a more documented feature set and a ready made knowledge base (like these forums). Specialized hardware will reduce that knowledge base and may require you to make nice with the manufacture (AKA - suck up to ) in order to get the information you want.
If you are speaking about a IP based security camera there should be instruction for its used and you may find those on the manufacturers website. I only have read about these items and they are basically a webserver with a built-in webpages for admin and user access. Once you configure the camera's server and any devices between it and the internet (via your ISP) you should be live.
all the best
Chris
|
|
|
|
|
Oaky I think that will help me to start with. thx.
Let me give you one simple example.
Assume that my device is router (any kind of router) also that is hardware and connected to modem so it does have internet connection. Now when you open that website 192.168.1.2 (or something like that) it asks you for username/PW which will be verified by your router and if u successfully sign in it will let you in and change functionality of that router depending upon security. So I believe that website (192.168.1.2) was hosted by that router and others can access to that website. IF necessary others will be connected to my device with LAN.
So yes that’s what I am talking about that’s the thing I want to do on my device, which also supports internet connection, so it’s like hosting web server from my device. So how do I start with that? Make some .exe file for web server and run that on router.
Again I do not have good experience with web-based applications and server so forgive me and point me to correct direction if I was off the road in any topic or failed to understand any concept.
Thx a lot for your help,
Cheers from Canada.
|
|
|
|
|
You may want to read up on addresses so you understand their implecations, such as the 192.168.x.x address you referenced.
try this[^] as a starting place as it will explain it better than I will.
|
|
|
|
|
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Dan Worsham -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
var myloc = window.location.href;
var locarray = myloc.split("/");
delete locarray[(locarray.length-1)];
var arraytext = locarray.join("/");
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<center>
<form>
<input type=button value="Show Current Directory Listing (Or Index.html Page)" onClick="window.location=arraytext;">
</form>
</center>
|
|
|
|
|
The answer to the question you didn't ask, can - of course - only be 42.
Ask Dan Worsham for further assistence.
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
Hi all,
I am new to this site and in the world of programming and I do not know is that my happiness is.
In fact, I wanted a small website consisting of a single page in PHP with a party administrator.
My website is slowing consist of a text that can be changed, and two images below the text that can be changed too.
The structure of my web page will be set all the time, but will have little content that changes.
Another quick question please, is that I can attach files like pictures to better explain?
Thank you
|
|
|
|
|
does anybody know a good site to download python.cause i don't
|
|
|
|
|
|
Luc's link is OK, but if you prefer a Microsoft solution, you might want to try this one[^].
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
|
|
Hi, I developed a Courses Student System Management.. in PHP, I published it to web..
And all i want is, To got anything the user types in the Registeration Page.. how can i do it ?
I mean, i want to get all the user details that he type in mywebsite..
|
|
|
|
|
read up on $_POST and $_GET in the php docs.
|
|
|
|
|
I know, i did it that way but i mean in my question: How can i send Form Data to my email ?
(with the submit button)
modified on Monday, August 30, 2010 12:26 PM
|
|
|
|
|
oh got it, $emailadd \
\thanks anyway !
|
|
|
|
|
the way I'd do it would be to redirect to a new page(could be blank, could redirect at the page before) that will take data from the form and send it to the email.
PHP command:
bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] ).
More about this: here
Paul.
|
|
|
|