-
Starting up the application reusing objects
As it turns out Ipage use php version 5.3.13. which rules out just about every framework I've looked at.
-
Starting up the application reusing objects
It definitely has clearer instructions than the other one. I need to check to see if it's compatible with my hosting company, ipage. If it is I'll give it a go. I've been looking at Yii, that looks pretty clear too.
-
Starting up the application reusing objects
That's kind of the same thing I went through making games. When I started off I wanted to write every line of code myself, and everyone was saying use a framework, but I found them intimidating. My last couple of games I started using a framework, and I wished I'd tried it sooner. It actually taught me a lot more about how to structure my code and it wasn't that bad when you just dived in. It was well documented though. Shame about code igniter, it had such clear instructions and tutorials. I do understnd the bascs of oop, but just not in regards to websites yet. I'm dedicating an hour and a half a day to going through code examples in books, and tutorials, and another hour and half making simple websites. I can't believe how slow I am at making a websites. So much I have to learn. I have an idea of a very complex website. That's why I've started in the first place, but now I'm realizing It will probably be about a year before I start it.
-
Starting up the application reusing objects
I looked at the inroduction on the Silex page. There so much I didn't understand I couldn't possibly use a framework like that yet. It already assumes you should know far more than I know.
-
Starting up the application reusing objects
I'm just learning the basics of php and mysql at the moment. But after I've made a few small websites to practice I think I will go with code igniter, as it seemed like the most straight forward. People always throw that reinvent the wheel phrase around to newbies who are trying to understand what the wheel actually is.
-
Starting up the application reusing objects
This is what I was trying and failing express http://stackoverflow.com/questions/1023282/maintain-object-state-with-different-pages-using-php .And answers my question. It was confusing me about keeping objects alive, but I see you pretty much just don't. That's gong to take some getting used to. But that tutorial, Weedy101, is awesome and very clear. Thanks again.
-
-
Starting up the application reusing objects
Thank you I will check out that tutorial. I'm not sure what you mean by class file should be in the background? Can you clarify please? I already have quite a bit of experience with javascript. I've made serveral quite complex games javascript, and I have made games in java. So I'm used to making objects. It's more of how to specifically do it in a website that's giving me trouble. I'm only just started learning php though. Thanks again for the link.
-
Starting up the application reusing objects
Sorry to post two topics in one day. I've been trying to get to grips with how to struture a very basic application. I've been trying to separate logic from the view and minimize global variables, like I keep reading you should do. The question I have about is the startup of an application. .<?php include('model.php'); $secretConfessions = new SecretConfessions(); class SecretConfessions { private $model; function __construct() { $this->model = new Model(); $this->go(); } function go() { if (isset($_POST['add_confession']) && isset($_POST['the_confession'])) { $this->model->addConfession($_POST['the_confession']); header('Location: secretconfessions.php'); exit(); } $confessions = $this->model->getConfessions(); $this->renderView($confessions); } function renderView($confessions) { include("view.php"); } } This will probably end up being my index page. Now at the top of the page I create a SecretConfessions object which I'm trying to make act as a controller, This contains the model (it won't always be called model). At the moment every time the user adds a confession (just an anonymous post) they will be redirected back here. But that will create another SecretConfessions object which will create another model object. How do I start of an application like this so it just creates the objects it needs once, without it doing it all again when the form is submitted. How would a website like twitter (but much much simpler) start up? Does it keep variables the whole time the user is adding posts?
-
Am I using a form where I shouldn't be?
Thank you very much. That works great.
-
Am I using a form where I shouldn't be?
Hello. I've been learning php, and I'm trying to make a simple website just as an excerise. It's called Secret Confessions. The user types in a confession and it posts to the page. That's it so far. I've used a form for this. But when I type in a confession post, then refresh the page I get a warning. Something like "Returning to the page may cause information to be repated". And information is repeated as the variables are still set. Now if this was twitter, or a facebook post, obviously you don't get this kind of warning. So should I not be using a form here at all? If not what should I use for this kind of thing?
-
Is this a terrible domain name?
What about revieweachother.com ? 3 words but it's discriptive. I think you could guess what I'm planning.
-
Is this a terrible domain name?
Thanks for the opinions, so far. My main concern with reviewreviewed is that it seemed a bit clumsy to me. Typing it out makes my eyes go funny. haha
-
-
Is this a terrible domain name?
reviewreviewed.com I've bought it just in case I decide to use it. (There's nothing there yet except my regular music site which was just put there automatically, so don't bother going there). What about songreviewgroup.com is that any better?
-
oop not quite working
In the first example it does not cause an alert because the alert is in the sayName function. To call it, add this code. person1.sayName();
-
Dynamically added elements disappear.
From what I've been reading, if you want to place the button inside a text field, you will have to do it with css and use relative positioning. I can't get this to work. If you take a look at this code. I'm trying to pass the idName I have created for the span element to the removeElement fucntion. But it does not work. It doesn't work because it ends up not passing the id name at all. If I place the idName in strings, if I try to append it as a string, or i've (as below) just stuck the name in there. I don't understand how I would do this or why this isn't working. Any ideas? it seems that the variable is out of scope when it gets called. Are the no experts reading this who can help us out? var idIndex = 1; function addField(element) { var field = document.getElementById(element); var spanElement = document.createElement("span"); var idName = "input" + idIndex; idIndex++; spanElement.setAttribute("id", idName); spanElement.innerHTML = "<input type='text'>"; spanElement.innerHTML += "<input type='button' value='X' onclick='removeField(idName)'>"; field.appendChild(spanElement); } function removeField(id) { // for some reason this is not receiving the Id name, so below code doesn't work. var element = document.getElementById(id); element.parentElement.removeChild(element); } Edit: spanElement.innerHTML += "<input type='button' value='X' onclick='removeField(idName)'>"; Ok so what is happening above is it's creating html text that would try and pass a variable named idName, which would not exist when it's called. However if I put quotes around idName, it then just passes a string named "idName". What I need to figure out is how to pass a string that says what the variable idName actually equals.