Jump to content

spiderwell

Members
  • Posts

    1,008
  • Joined

  • Last visited

Everything posted by spiderwell

  1. 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/
  2. 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?
  3. it will be automated when you write the script to do it!!
  4. 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="" />
  5. it was down to nested <spans> in a <h2>, or something like that, fixed now!
  6. 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]
  7. 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.
  8. my thoughts aren't much use to you, as all I am thinking is thats odd, and I hate intermittent errors!
  9. i use ipsum.com for test text, and the images i find from microsoft in 'my documents'
  10. new years eve must be very emotional for you
  11. 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.
  12. 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');
  13. putting ($int2-$int1) did it for me same on the +
  14. 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
  15. telling us the values of $int1 and $int2 might help or that self explanatory too
  16. <?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
  17. i loves the jquery for ajax stuff.
  18. 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.
  19. 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?
  20. 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
  21. 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).
  22. This should help someone help you, I've not used imap in php sorry about that!
  23. 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>"; ?>
  24. 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)
  25. 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 .
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.