PHP - Trying To Remember Name Of Old Framework
Okay, this is a head scratcher for me... About 10-15 years ago, there was this framework that seemed to be pretty popular in the LAMP work for quickly building websites. (I think it was written in PHP.) The thing I recall about it was that it you could create your own markup tags to markup up fields using curly brackets { }. I wish I could be more specific but this is all that is coming to mind. Any clues of what I might be thinking about? Similar TutorialsThis topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=347122.0 hi all, does anyone know the name of the following its a way to make a huge string than can have variables in it. look a bit like this but couldnt remember the right syntax, nor the name so was kinda hard to look on google. ABC>>> some stuff inside ABC; I want to save live data into file. My script fetch the data (one by one) and save it into file by amend method. The live data is not regular and every time it must be checked if the value has been updated or it is still the last value. One way to do so is to read the last line of the file and compare it with the fetched value. But in this case, I need to read the file for every check. Is there a way to remember the last value and compare it with the coming value? to write only new value into the file. Hey guys not sure what this is called but does anyone have more information on it. Ok when you visit a part of a site or a profile or what ever?? :S:S and you redirect them to login how can u then send them back to where they was when they have logged in? hope someone can help. Hi, I'm creating a remember me feature for my site which obviously sets a cookie and when the visitors loads the site again,he would already be logged in. This is a part of the code which is related : Code: [Select] $login_email = request_var('login_email', ''); $login_password = request_var('login_password', ''); $login_remember = (isset($_POST['remember']) && $_POST['remember'] == 1) ? true: false; setcookie('login_email', $_POST['login_email'], time()+60*60*24*365, '/','localhost',false); setcookie('login_password', md5($_POST['login_password']), time()+60*60*24*365, '/','localhost',false); HTML: Code: [Select] <strong class="normal"><input type="checkbox" name="remember" value="1">Remember</strong> Hi guys, I wonder if any if you could help me: I have created a login page with "remember me" function... The page will redirect either to Admin Page or User Page depends their 'level'. But when I logged in as Admin and checked the box "remember me" and close all the browser to see IF the "remember me" work. When I open a new browser - and go to the index page - it is okay, I can view the page.... but it redirect me to the USER page NOT Admin page. Does anyone know why this happens? Time to ask a stupid question. I have a remember me cookie being set for my login page but I'm wondering what I need to do so that the next time the user comes back to the login page it already has the checkbox checked and the username in the username field which is the cookie. I am wondering how to keep a checkbox checked? I have the folllowing code and it is outputting the correct info, but when i tick checkbox, and then click box "SAVE Days and Recipes Chosen" the checkbox doesn't get set. <?php for($i = 0; $i < $rows; $i++) { ?> <tr> <?php for($j = 0; $j < $columns; $j++) { echo "<TD><font color='8678E9'>" . $data[$i + ($j * $rows)] . "</font></TD>\n"; ?> <td><input type='checkbox' name=$R1 <?php if($R1=="checked"){$R1=="checked"; echo $R1;} elseif($R1=="unchecked"){$R1=="unchecked"; echo $R1;} ?> <td><?php echo"<TD><font color='3923D6'><font size=4>" . $data2[$i + ($j * $rows)] . "</TD>\n"; ?></font></td> <?php echo"<TD align='center'><font color='3923D6'><font size=4>" . $data4[$i + ($j * $rows)] . "</TD>\n"; ?></font></td> <?php echo"<TD align='center'><font color='3923D6'><font size=4>" . $data5[$i + ($j * $rows)] . "</TD>\n"; ?></font></td> <td align="centre"><input type="checkbox" name="ch1[]" method="POST" value=<?php echo $data3[$i + ($j * $rows)]?>,1 >M<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,2 method="POST">Tu<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,3 method="POST">W<br> <input type="checkbox" name="ch4[]" <?php if (!isset($ch4)){$Value='unchecked'; echo $Value;} elseif(isset($ch4)){$Value='checked'; echo $Value;}?> value=<?php echo $data3[$i + ($j * $rows)]?>,4 method="POST">Th<br></td> <td align="centre"><input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,5 method="POST">F<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,6 method="POST">Sa<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,7 method="POST">Su<br></td> <?php echo"<TD><font color='3923D6'><font size=4>" . $data6[$i + ($j * $rows)] . "</TD>\n"; ?></font></td> <td style='font-weight: bold; text-align: left;'><font color='8678E9'>                    </font></td> <?php } echo "</TR>\n"; } echo "</TABLE>\n"; echo "<br>"; It is the following part that i cuurently need help with <td><input type='checkbox' name=$R1 <?php if($R1=="checked"){$R1=="checked"; echo $R1;} elseif($R1=="unchecked"){$R1=="unchecked"; echo $R1;} ?> I haven't looked at the other checkbox part of <td align="centre"><input type="checkbox" name="ch1[]" method="POST" value=<?php echo $data3[$i + ($j * $rows)]?>,1 >M<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,2 method="POST">Tu<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,3 method="POST">W<br> <input type="checkbox" name="ch4[]" <?php if (!isset($ch4)){$Value='unchecked'; echo $Value;} elseif(isset($ch4)){$Value='checked'; echo $Value;}?> value=<?php echo $data3[$i + ($j * $rows)]?>,4 method="POST">Th<br></td> <td align="centre"><input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,5 method="POST">F<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,6 method="POST">Sa<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,7 method="POST">Su<br></td> Appreciate any suggestions I wirte php... do i use a framework?.. if so what framework do i use?... When i do phpinfo(); ... i get a screen that says: This program makes use of the Zend Scripting Language Engine: so do i use the zend framework? regards J Hi, I have been doing small scale programming but I am now planning to foray into large scale, intensive web application to handle high traffic, definitely I need something fast, efficient and re-usable. Since I am programming for a while, I have my own collection of code which I use for base and generally am able to build fast and secure (small) web application. But now I am looking into framework. So, here is the question.. Should I look into framework like Yii , Kohana etc.. or Should continue building on my own code .. I just don't want to learn all those framework if and but then at the decides not to use them as I find them not really helpful !!! Hi, I'm trying to write my own php mvc framework, but I don't know where to start. I have been using codeigniter for a while, then i thought i shouldn't use it, because I'm not getting smarter when most of the code is written for me. So, writting my own framework would be a great practice to learn oop, i guess. I need: url routing, the would work like codeigniter's (http://website.com/controller/method/some/other/params) and calling some function for rendering layout files similar to codeigniter's ($this -> load -> view ( 'file.php' ); and not like this: $header = new Template ( 'header.php' ); then some coding with header, and same with content.php and footer.php). Can anyone please help me? Where to start? sorry for bad English Hi I'm hoping someone can point me in the right direction. I'm trying to create a single page that contains a couple of checkboxes. When the first checkbox is checked I want to set a session. When the second chechbox is checked I want to set a different session. When the page submits ( to itself ) I'd like the checkboxes to reflect if they are checked or not. I can sort of do that part,but I'm having major issues with unsetting the sessions and updating the checkboxes to reflect this. Does anyone have a simple example on how to do this. Many Thanks So I have a registration form setup. When the user submits the form it sets session variables for each of the form fields and then checks the database to see if the username is taken. If the username is taken I have the form fields values to display the value of what the user just submitted. My problem is I have 2 drop down fields: States and Countries I am using the the following for my countries dropdown box and it works to remember the selection the user made, BUT how can I have it remember the option name as well as the option value? IE if the user chooses United States of America and submits the form I want the drop down to display United States of America not US here is the code: <select id="country" name="country" tabindex = "511"> <option value="<?php if(isset($_SESSION['country'])) echo $_SESSION['country']; ?>" selected="<?php if(isset($_SESSION['country'])) echo $_SESSION['country']; ?>"><?php if(isset($_SESSION['country'])) echo $_SESSION['country']; ?></option> <option value="">(please select a country)</option> <option value="AF">Afghanistan</option> <option value="AL">Albania</option> <option value="DZ">Algeria</option> <option value="AS">American Samoa</option> <option value="AD">Andorra</option> <option value="AO">Angola</option> <option value="AI">Anguilla</option> <option value="AQ">Antarctica</option> <option value="AG">Antigua and Barbuda</option> <option value="AR">Argentina</option> <option value="AM">Armenia</option> <option value="AW">Aruba</option> <option value="AU">Australia</option> <option value="AT">Austria</option> <option value="AZ">Azerbaijan</option> <option value="BS">Bahamas</option> <option value="BH">Bahrain</option> <option value="BD">Bangladesh</option> <option value="BB">Barbados</option> <option value="BY">Belarus</option> <option value="BE">Belgium</option> <option value="BZ">Belize</option> <option value="BJ">Benin</option> <option value="BM">Bermuda</option> <option value="BT">Bhutan</option> <option value="BO">Bolivia</option> <option value="BA">Bosnia and Herzegowina</option> <option value="BW">Botswana</option> <option value="BV">Bouvet Island</option> <option value="BR">Brazil</option> <option value="IO">British Indian Ocean Territory</option> <option value="BN">Brunei Darussalam</option> <option value="BG">Bulgaria</option> <option value="BF">Burkina Faso</option> <option value="BI">Burundi</option> <option value="KH">Cambodia</option> <option value="CM">Cameroon</option> <option value="CA">Canada</option> <option value="CV">Cape Verde</option> <option value="KY">Cayman Islands</option> <option value="CF">Central African Republic</option> <option value="TD">Chad</option> <option value="CL">Chile</option> <option value="CN">China</option> <option value="CX">Christmas Island</option> <option value="CC">Cocos (Keeling) Islands</option> <option value="CO">Colombia</option> <option value="KM">Comoros</option> <option value="CG">Congo</option> <option value="CD">Congo, the Democratic Republic of the</option> <option value="CK">Cook Islands</option> <option value="CR">Costa Rica</option> <option value="CI">Cote d'Ivoire</option> <option value="HR">Croatia (Hrvatska)</option> <option value="CU">Cuba</option> <option value="CY">Cyprus</option> <option value="CZ">Czech Republic</option> <option value="DK">Denmark</option> <option value="DJ">Djibouti</option> <option value="DM">Dominica</option> <option value="DO">Dominican Republic</option> <option value="TP">East Timor</option> <option value="EC">Ecuador</option> <option value="EG">Egypt</option> <option value="SV">El Salvador</option> <option value="GQ">Equatorial Guinea</option> <option value="ER">Eritrea</option> <option value="EE">Estonia</option> <option value="ET">Ethiopia</option> <option value="FK">Falkland Islands (Malvinas)</option> <option value="FO">Faroe Islands</option> <option value="FJ">Fiji</option> <option value="FI">Finland</option> <option value="FR">France</option> <option value="FX">France, Metropolitan</option> <option value="GF">French Guiana</option> <option value="PF">French Polynesia</option> <option value="TF">French Southern Territories</option> <option value="GA">Gabon</option> <option value="GM">Gambia</option> <option value="GE">Georgia</option> <option value="DE">Germany</option> <option value="GH">Ghana</option> <option value="GI">Gibraltar</option> <option value="GR">Greece</option> <option value="GL">Greenland</option> <option value="GD">Grenada</option> <option value="GP">Guadeloupe</option> <option value="GU">Guam</option> <option value="GT">Guatemala</option> <option value="GN">Guinea</option> <option value="GW">Guinea-Bissau</option> <option value="GY">Guyana</option> <option value="HT">Haiti</option> <option value="HM">Heard and Mc Donald Islands</option> <option value="VA">Holy See (Vatican City State)</option> <option value="HN">Honduras</option> <option value="HK">Hong Kong</option> <option value="HU">Hungary</option> <option value="IS">Iceland</option> <option value="IN">India</option> <option value="ID">Indonesia</option> <option value="IR">Iran (Islamic Republic of)</option> <option value="IQ">Iraq</option> <option value="IE">Ireland</option> <option value="IL">Israel</option> <option value="IT">Italy</option> <option value="JM">Jamaica</option> <option value="JP">Japan</option> <option value="JO">Jordan</option> <option value="KZ">Kazakhstan</option> <option value="KE">Kenya</option> <option value="KI">Kiribati</option> <option value="KP">Korea, Democratic People's Republic of</option> <option value="KR">Korea, Republic of</option> <option value="KW">Kuwait</option> <option value="KG">Kyrgyzstan</option> <option value="LA">Lao People's Democratic Republic</option> <option value="LV">Latvia</option> <option value="LB">Lebanon</option> <option value="LS">Lesotho</option> <option value="LR">Liberia</option> <option value="LY">Libyan Arab Jamahiriya</option> <option value="LI">Liechtenstein</option> <option value="LT">Lithuania</option> <option value="LU">Luxembourg</option> <option value="MO">Macau</option> <option value="MK">Macedonia, The Former Yugoslav Republic of</option> <option value="MG">Madagascar</option> <option value="MW">Malawi</option> <option value="MY">Malaysia</option> <option value="MV">Maldives</option> <option value="ML">Mali</option> <option value="MT">Malta</option> <option value="MH">Marshall Islands</option> <option value="MQ">Martinique</option> <option value="MR">Mauritania</option> <option value="MU">Mauritius</option> <option value="YT">Mayotte</option> <option value="MX">Mexico</option> <option value="FM">Micronesia, Federated States of</option> <option value="MD">Moldova, Republic of</option> <option value="MC">Monaco</option> <option value="MN">Mongolia</option> <option value="MS">Montserrat</option> <option value="MA">Morocco</option> <option value="MZ">Mozambique</option> <option value="MM">Myanmar</option> <option value="NA">Namibia</option> <option value="NR">Nauru</option> <option value="NP">Nepal</option> <option value="NL">Netherlands</option> <option value="AN">Netherlands Antilles</option> <option value="NC">New Caledonia</option> <option value="NZ">New Zealand</option> <option value="NI">Nicaragua</option> <option value="NE">Niger</option> <option value="NG">Nigeria</option> <option value="NU">Niue</option> <option value="NF">Norfolk Island</option> <option value="MP">Northern Mariana Islands</option> <option value="NO">Norway</option> <option value="OM">Oman</option> <option value="PK">Pakistan</option> <option value="PW">Palau</option> <option value="PA">Panama</option> <option value="PG">Papua New Guinea</option> <option value="PY">Paraguay</option> <option value="PE">Peru</option> <option value="PH">Philippines</option> <option value="PN">Pitcairn</option> <option value="PL">Poland</option> <option value="PT">Portugal</option> <option value="PR">Puerto Rico</option> <option value="QA">Qatar</option> <option value="RE">Reunion</option> <option value="RO">Romania</option> <option value="RU">Russian Federation</option> <option value="RW">Rwanda</option> <option value="KN">Saint Kitts and Nevis</option> <option value="LC">Saint LUCIA</option> <option value="VC">Saint Vincent and the Grenadines</option> <option value="WS">Samoa</option> <option value="SM">San Marino</option> <option value="ST">Sao Tome and Principe</option> <option value="SA">Saudi Arabia</option> <option value="SN">Senegal</option> <option value="SC">Seychelles</option> <option value="SL">Sierra Leone</option> <option value="SG">Singapore</option> <option value="SK">Slovakia (Slovak Republic)</option> <option value="SI">Slovenia</option> <option value="SB">Solomon Islands</option> <option value="SO">Somalia</option> <option value="ZA">South Africa</option> <option value="GS">South Georgia and the South Sandwich Islands</option> <option value="ES">Spain</option> <option value="LK">Sri Lanka</option> <option value="SH">St. Helena</option> <option value="PM">St. Pierre and Miquelon</option> <option value="SD">Sudan</option> <option value="SR">Suriname</option> <option value="SJ">Svalbard and Jan Mayen Islands</option> <option value="SZ">Swaziland</option> <option value="SE">Sweden</option> <option value="CH">Switzerland</option> <option value="SY">Syrian Arab Republic</option> <option value="TW">Taiwan, Province of China</option> <option value="TJ">Tajikistan</option> <option value="TZ">Tanzania, United Republic of</option> <option value="TH">Thailand</option> <option value="TG">Togo</option> <option value="TK">Tokelau</option> <option value="TO">Tonga</option> <option value="TT">Trinidad and Tobago</option> <option value="TN">Tunisia</option> <option value="TR">Turkey</option> <option value="TM">Turkmenistan</option> <option value="TC">Turks and Caicos Islands</option> <option value="TV">Tuvalu</option> <option value="UG">Uganda</option> <option value="UA">Ukraine</option> <option value="AE">United Arab Emirates</option> <option value="GB">United Kingdom</option> <option value="US">United States</option> <option value="UM">United States Minor Outlying Islands</option> <option value="UY">Uruguay</option> <option value="UZ">Uzbekistan</option> <option value="VU">Vanuatu</option> <option value="VE">Venezuela</option> <option value="VN">Viet Nam</option> <option value="VG">Virgin Islands (British)</option> <option value="VI">Virgin Islands (U.S.)</option> <option value="WF">Wallis and Futuna Islands</option> <option value="EH">Western Sahara</option> <option value="YE">Yemen</option> <option value="YU">Yugoslavia</option> <option value="ZM">Zambia</option> <option value="ZW">Zimbabwe</option> </select> I know this question sounds a bit vague. I have not been working with php too long, maybe 6 months or so. I have worked with other programming languages and do have a good grasp of OOP. I have a few ideas for some apps I want to make, nothing that will be the next commercial hit. I just to do some php apps to get better at php. Everywhere I look some one is talking about a framework, and it looks like Codeigniter seems to be everyones fave, despite the fact that there is a good chance it will die out soon. I ended up giving Codeigniter a try and although I understand MVC, and I get OOP, and all of that, it seems there are many ways to set things up and a lot of the tutorials I tried out had different ways to do things withing Codeigniter, the problem with that is some of the stuff I learned on tutorials I could not get to work on my set up. I got frustrated and simply gave up after a while of tinkering with CI. I know there are plenty other frameworks, but I am wondering if I will truly be at a disadvantage if I just write core php with out using a framework.
Thanks if advance for the input.
Hi, I am going to start a project which would be like a single page site, sending requests from one page and displaying result on same page. I would like to know which framework would be better. here i see top 10 frameworks http://www.phpframeworks.com/top-10-php-frameworks/ any suggestion please? Thanks <?php class Action { protected $_request; protected $_response; protected $_model; protected $_view; public function __construct(Request $request, Response $response) { $this->set_request($request)->set_response($response)->set_view($request, $response)->set_model(); // if request requires partial then do this $partial = Partial::singleton(); $view = $this->get_view(); $view->set_partial($partial); $partial->set_view(clone $view); } protected function set_request(Request $request) { $this->_request = $request; return $this; } protected function set_response(Response $response) { $this->_response = $response; return $this; } protected function set_view(Request $request, Response $response) { $this->_view = new View($request, $response); return $this; } public function get_request() { return $this->_request; } public function get_response() { return $this->_response; } public function get_view() { return $this->_view; } public function dispatch($method, $parameters) { if ($this->get_request()->is_dispatched()) { if(method_exists($this, $method)) { call_user_func_array(array($this, $method), $parameters); } else { echo "unable to load method"; } } } public function __get($property) { $property = '_' . $property; if (property_exists($this, $property) && $property !== '$this->_request' && $property !== '$this->_responce') { return $this->$property; } return false; } public function set_model() { $class_name = get_class($this); $model_name = trim($class_name, "_Controller"); $model_name = strtolower($model_name); $property_name = '_' . $model_name; $model_name = Inflection::singularize($model_name); $model_name = ucfirst($model_name); $model_class = $model_name . '_Model'; $this->{$property_name} = new $model_class(); } } <?php class View { protected $_variables = array(); protected $_helpers = array(); public function __construct(Request $request, Response $response) { } public function __set($name, $value) { $this->_variables[$name] = $value; } public function __get($name) { return $this->_variables[$name]; } public function __call($name, $parameters) { $helper = $this->get_helper($name); if (!$helper) { $helper = call_user_func_array(array(new $name(), '__construct'), $parameters); $this->set_helper($name, $helper); } return $helper; } protected function set_helper($helper, $instance) { $this->_helpers[$helper] = $instance; } protected function get_helper($helper) { if (isset($this->_helpers[$helper])) { return $this->_helpers[$helper]; } return false; } public function set_partial(Partial $partial) { if ($partial instanceof Partial) { $this->set_helper('partial', $partial); } } public function render($file) { if (preg_match("/\.html$/i", $file)) { require_once PRIVATE_DIRECTORY . 'application' . DS . 'views' . DS . $file; } } } <?php class Partial { protected $_view; protected $_templates; protected static $_instance = null; public static function singleton() { if (self::$_instance == null) { self::$_instance = new self(); } return self::$_instance; } public function set_view(View $view) { $this->_view = $view; } public function __set($name, $options = array()) { $this->_templates[$name]; $this->_templates[$name]['path'] = $options[0]; $this->_templates[$name]['variables'] = $options[1]; } public function __get($name) { // when $this->paertial()->header; is called in view template // it extracts variables and includes template view render() method $file = $this->_templates[$name]['path']; $variables = $this->_templates[$name]['variables']; } }Hey guys im trying to make alternations to my personal framework by adding a Partial class as a helper to the View class so that I'm able to add partial templates in my bootstrap and load accordingly in my view template like a header and footer. what im after is a bit of advise on the functioning of my Action/View and Partial please (not sure if what im doing is really right although it does work) Basically my Controller will extend my action where a model and view is made for my controller to use. Then my partial class is sent as a helper to my view and a clone of view sent to my partial so that im able to use the view class in my partial to render my header and variables. (is this the correct way? or a good method?) here's my code...like I said any advise would be greatly appreciated... thank you Hello guys, okay? hey guys im having a bit of trouble getting $_GET in my framework. now the ony way to get query from a url such as:
users/activate-account?email_address=test&token=test
i have to use $_SERVER['REQUEST_URI'] unless im doing something wrong?
[REQUEST_URI] => /bisi/user/activate-account?email_address=test&token=test
by doing this:
print_r($_GET);all i get is : Array ( [uri] => user/activate-account ) just concerned im doing something wrong?...any advise on this please guys. was thinking of doing something like this in my request public function get_query($name = null) { $uri = $_SERVER['REQUEST_URI']; if (parse_url($uri, PHP_URL_QUERY)) { $query = explode("?", $uri); $query = explode("&", $query[1]); $array = array(); foreach ($query as $string) { $string = explode("=", $string); $query_name = $string[0]; $query_value = $string[1]; $array[$query_name] = $query_value; // $_GET[$query_name] = $query_value; possibly? } if ($name !== null && array_key_exists($name, $array)) { return $array[$name]; } return $array; } return null; }thanks Hi guys
I am a php programmer and in a big confusion. I want to learn a framework, but can't figure out which one start ?
CakePHP
Codelgniter
Symfony
laravel
I am new to them, so you can suggest me which one to start 1st and move on to other. Or If i miss any other framework , you can tell me that also.
Any help is appriciable.
Thanks
|