-
Posts
3,584 -
Joined
-
Last visited
-
Days Won
3
Everything posted by JonnoTheDev
-
The correct function is session_start() not start_session()! The session will be maintained throughout the application and should not change its id unless it is destroyed or you are failing to restore it using the session_start() function. You should place this function in an include common to all files so you do not have to add the function to all scripts, just make sure the file is included i.e include('config.inc.php'); If you are using the session id to querythe db, are you implying that you have a custom session handler using database storage? If so, maybe your problem lies there.
-
If you want to use friendly urls you could structure like /page/titlea/1 /page/titleb/2 /page/titlec/3 as stated mod_rewrite is used for this
-
You use the primary key to identify the page i.e <a href="page.php?id=1">A</a> <a href="page.php?id=2">B</a> <a href="page.php?id=3">C</a> When a user lands on page.php you get the database record to display i.e // page.php $result = mysql_query("SELECT * FROM tablename WHERE id='".mysql_real_escape_string($_GET['id'])."'"); $row = mysql_fetch_assoc($result); print "You are on page: ".$row['title']; To display the links select the records from the database and loop through them
-
You aren't executing this through a web browser are you?
-
Maybe the reason why youtube are dropping IE6 support
-
proper redirect <?php if(!strlen(trim($_SESSION['username']))) { header("Location:index.php"); exit(); } ?>
-
Really hope the GF gets me an XBOX for Christmas!
-
I have come to believe that it is FACT that general computer users are switching their PC's to MACs, not because they offer any more functionality, but simply because they look cool. A large number of our clients have now switched to a MAC. When you ask the question, why? The most common answer is because they look good. This is highly frustrating when they do not know how to use the damn thing! I have to admit though, a friend was showing me his new macbook connected up to a 42in Sony flatscreen and after about 5 minutes I was thinking, 'I have to have one. I need one'. Until I can afford this sexy piece of technology, I guess I will have to hide in the corner with my Toshiba while MAC users look over in disgust. Maybe I can spray paint it white for the time being.
-
You can check the http status code from the url i.e a 200 or a 302 is valid. <?php function httpHeader($server) { $fp = @fsockopen($server,80,$errno,$errstr,30); $out = "GET / HTTP/1.1\r\n"; $out .= "Host: $server\r\n"; $out .= "Connection: Close\r\n\r\n"; @fwrite($fp,$out); $content = @fgets($fp); if(strstr($content, "200") || strstr($content, "302")) { return true; } return false; } // usage if(httpHeader("www.bing.com")) { print "url ok"; } else { print "bad url"; } ?>
-
This guy is talking absolute tripe! Windows does not run on DOS, it has not done so for years! It has DOS emulation in the form of a command prompt (shell), the DOS apps are still there i.e copy, xcopy, fdisk. When you boot win 2k, xp, vista etc do you see any DOS screens? NO.
-
This won't be because of CSS though
-
No such thing. There are functions that you will use a lot more than others such as functions that work with strings or arrays but esentially a function is a function. Use the php manual to learn how to use built in functions http://www.php.net The best place to learn is from a book. This is the most obvious place. Online tutorials are good but every developer has their own style so trawling through them may become confusing when 2 different tutorials that do the same thing are written different. Once you know the core basics from a book like, variables, constants, functions, arrays, cookies, sessions, etc then examples you see online will make much more sense.
-
If most of your small projects include identical features then what I would do is create a package. Let say most clients have blogs, dynamic page content, galleries & images, etc. Create a script that you can package and install, switch features on and off. Have a selection of templates. When you have a new client you can just install a new project from the command line. When you talk about updaing these sites it is easy to create update packages that can be deployed across the board in one go, not going through 50 sets of site files. You could create a deployement script that will extract any updates and install to all site files from your server, etc.
-
I really think that you are getting confused with the term framework. What you are describing above is a CMS or a project. Read http://framework.zend.com/docs/quickstart There is no such thing as a MVC design for a framework. As I said MVC is a 'design pattern', not design as in page layout. I think you are talking about the layout of your applications as in front end! This is not what the MVC is about. It is a pattern for separating the presentation (view) from the application logic and access to the data.
-
I think you should always bother, you have no idea what browsers your potential users will have. https://browserlab.adobe.com/index.html Use to check out your site in different browsers.
-
Of course. This is part of your framework Not sure where this is mentioned. If you believe your approach will save you time and will be easy to manage then just go ahead and build it and see how it works out. I personally would not use a single system to manage the data acreoss multiple sites or applications, nor would I use a single database for many applications either when they have different features. I believe that this will cause more pain for you. Back to one of your original questions This doesn't make sense. MVC is a design pattern and is available for use in your app by most frameworks. I am familiar with Zend and CodeIgnitors implementation, but do not understand what you mean by main layout for the framework and sub-layouts.
-
Bad, looking through access logs on our servers shows IE6 is still a popular browser. It seems that you do not want to take the time to make it work on all browsers thus you are alienating potential customers.
-
I do not understand how you can have a single CMS for all projects. Yes your CMS can be built using your framework, but if I had 2 projects, one being an ecommerce application and the other a social networking app how can one CMS manage both systems? This is impossible as the feature list is completely different between the 2 projects. Write you framework and then build your CMS from it. A CMS should be per project. What if you needed to move the project to another server?
-
Can somone donate me a few bucks? only need like 2-3$..
JonnoTheDev replied to Gayner's topic in Miscellaneous
What about a crate of Fosters or 4X? I'll do it for a shrimp off your barby. -
Can somone donate me a few bucks? only need like 2-3$..
JonnoTheDev replied to Gayner's topic in Miscellaneous
I'll register foffyoucheapskate.com out of the good of my heart if you like. -
http://shop.yourphppro.com/elePHPant.html
-
None, haven't a netbook. But it makes sense that netbooks are primarily for using the net so a Google OS with its apps integrated sounds like it fits the bill.