-
Posts
1,008 -
Joined
-
Last visited
Everything posted by spiderwell
-
read this, it is very useful and does what you want to do. http://anantgarg.com/2009/03/13/write-your-own-php-mvc-framework-part-1/
-
i run wamp on my laptop, and have just started an attempt at an MVC styled website, and had got myself to a point were I was ready to run a test page with a simple view page showing my $_GET array just to test it all worked. I was for the first time using buffering like this, which was in a class called via the page: <?php ob_start(); require_once('../ph-admin/views/sample.php'); $txtDisplay = ob_get_contents(); ob_end_clean(); ?> I then echoed $txtDisplay in the page to show the final out put of sample.php. all it would do though was show the actual php code in sample and in the main page. 3 days of endless jigging around and hairpulling I finally worked out it was because those 2 bits of scripts had short tags and my dev environment had them turned off!! sad but true!! lols I was convinced it was to do with the buffering since I was my first attempt at trying that, and didn't even think to check short tags!! Anyone else want to confess to something stupid like this?
-
it will be automated when you write the script to do it!!
-
your post is hard to understand unfortunately, but what is the problem with creating a class in css to apply to all the labels? you would do it like any other class you have. <label class="someclass" >Name</label><input class="inputname" type="text" name="name" value="" /><input class="inputsurname" type="text" name="surname" value="" />
-
it was down to nested <spans> in a <h2>, or something like that, fixed now!
-
hey all, have got a real odd one here, and just wondered if anyone had come across something like this themselves. I have a prduct list, and each <li> has a product with its info and an image. however in IE 7/8, the text shrinks a little bit, so within 4 <li> its barely readable!!! I dont have the css to show right now but here is a screeny of the issue, and looking on line hasn't given me much in google. thought I'd just wave it under everyone's nose to see if they had come across it before. [attachment deleted by admin]
-
IE not processing form with input type of image
spiderwell replied to Ricky55's topic in PHP Coding Help
i know a work around, but the way to find out if its submit_x would be print_r($_POST) to find out what that submit comes up with, i'm pretty sure that is what happens thoough with image submits, i had this issue myself in the past. workaround: hidden field, check for hidden field in $_POST, go from there. -
HEEELP...Dreaded Upload Permissions
spiderwell replied to dariussutherland's topic in PHP Coding Help
my thoughts aren't much use to you, as all I am thinking is thats odd, and I hate intermittent errors! -
i use ipsum.com for test text, and the images i find from microsoft in 'my documents'
-
new years eve must be very emotional for you
-
i think a super shit hitting a super fan is better than a shit super hitting the fan oh and iirc mayans didn't predict the end of the world, their calendar just ran out.
-
not sure exactly what you are trying to achieve. you want to include a page and pass an action variable to it? include('why.php?action=$somevalue');
-
super easy problem involving simple math functions
spiderwell replied to silverglade's topic in PHP Coding Help
putting ($int2-$int1) did it for me same on the + -
Post for pic, location and youtube error message
spiderwell replied to rdkd1970's topic in PHP Coding Help
it means you are looking for the variable when it doesnt exist so its an undefined index. use isset() to check its existence first and then if true carry on your script -
super easy problem involving simple math functions
spiderwell replied to silverglade's topic in PHP Coding Help
telling us the values of $int1 and $int2 might help or that self explanatory too -
<?php switch ($page) { case 'how': include('how.php'); break; case 'why': include('why.php'); break; default: include('index.php'); } ?> in this example if $page's value isn't listed it will do default at the bottom taken from http://php.net/manual/en/control-structures.switch.php and adapted slightly to your stuff
-
i loves the jquery for ajax stuff.
-
using a switch statement would be better than that long if .. elseif statement. it also has a default setting for when the value of $page isn't found, which can be used to redirect to a 'page not found' page or index/whatever.
-
either you want it or you don't? lol ckeditor isn't hard to 'install' into a page to edit content. but if you don't want to do any coding, which it sounds like, why not just take an 'out the box' solution like wordpress?
-
Single form POST method to multiple action pages...?
spiderwell replied to shamwowy's topic in PHP Coding Help
you could process the info you require and save to the db, then use php to echo out a form and place the CC info into that form, using the php to then echo out a javascript command to submit form to the CC company when page is loaded. there might well be a way to post to a url via php directly but i don't know it if it does exist. lol -
I would use ajax, or jquery to implement such a change, and if you google either subject with things like edit in place you can find an example very easily the way i do it is that there are no input boxes on show by default, and they replace the existing text, when you double click the text (under value column for instance).
-
This should help someone help you, I've not used imap in php sorry about that!
-
it can be done, but its not really a proper method. you have to echo out javascript in php. <?php $myphpvar = "im a php variable"; echo "<SCRIPT>"; echo "alert('" . $myphpvar . "');"; echo "</SCRIPT>"; ?>
-
Storing data in an array? Is this the best way?
spiderwell replied to slaterino's topic in PHP Coding Help
personally i pass it all into a long string as shown by mjdamato, and would only pass it to another array if I needed to do other things with that data again later in the page/script. I have rarely done this, only really in MVC where the display is seperated from the database functions (MVC is Model View Controller, its an method of application design, applicable to any programming language, in case you didn't know) -
if you have the 'blank' file saved already, use the file object to read the file into a variable, and use str_replace() to change it. $filetext = str_replace('change1','localhost',$filetext); assume i have read the file contents of the example you gave, into $filetext, I then ask it to look for 'change1' in that string and replace that with 'localhost', and pass it back to the $filetext. i would then write that variable to the file and save file .