Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'php'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



  1. In the following code I am validating a url in a practice page I am using from the stuff I learned in the book­. When I enter an invalid url in my form, I get an $url undefined error when running the code below. I am guessing the error is pretty easy to spot, but I am new at this. if (filter_var($scrubbed['url'], FILTER_VALIDATE_URL)){ $url = mysqli_real_escape_string($dbc, $scrubbed['url']); } else { echo '<p class="error">Please enter a valid url</p>'; }
  2. I am on Chapter 18, I created all the files and they seem to be all like it is written in the book, when I logout I can still see the user menu, if I click on one of the user links it takes me back to the index.php (some of the time) page which is great, meaning I am logged out. But why can I still see the Logged in User links even after I click on logout, sometimes when I click on the user links I can even get to the logged in page after I am logged out. I double checked my login and logout pages and they seem the same as in the book. Is this normal??
  3. hi i uploaded a website using the includes infrastructure exampled in this book my base uri for xamp is define ('BASE_URI', '/C:xamp/htdocs/'); and it works fine but im using filezilla to upload folders to my site hosting on go daddy and when i use my httpdocs path define ('BASE_URI', '/httpdocs/'); i get this error: PHP Fatal error: require(): Failed opening required '/httpdocs/mysql.inc.test.php' (include_path='.;.\includes;.\pear') in G:\PleskVhosts\axebs.com\httpdocs\index.php on line 16 any tips on what i need to set my path to to work on filezilla??
  4. i have to tables that are link and i want to view contents of a single item when i select it, what is the correct syntax of using $post in yii ie SELECT tbl_emp.emp_id, tbl_emp.sname, tbl_fname, tbl_educ.empl_id FROM tbl_emp, tbl_edu WHERE tbl_emp.emp_id=$_POST['emp_id'] AND tbl_edc.emp_id=$_PSOT['emp_id'];
  5. In Chapter 19, the $_SESSION['customer_id'] variable is often used for things like isset($_SESSION['customer_id']) why though can't we use other table columns that are like customer_id in the $_SESSION[] for example $_SESSION['order_id'] In chapter 19 also, the $_GET['id'] is the same id as the customer's. Why is it the same? Where does it get declared as the same, I have searched through the scripts and I don't see it. I am trying to create a script where users can view their past orders. The trouble I am having is calculating the total amount of the order in the checkout.php scrip
  6. In page 99, session_regenerate_id() cause en error "Cannot regenerate session id - headers already sent". If i comment this function out, everything goes fine. Where I should check for problem? thanks
  7. My question is why in the following mysql statement does the $id at the end, not have to be in single quotes, whereas other variables in this statement are in quotes. $u = "UPDATE customers SET first_name='$fn', last_name='$ln', email='$em', address='$add', zipcode='$zip', city='$city', state='$state', country='$coun' WHERE customer_id = $id";
  8. I am using the structure of Script 3.5 (Calculator.php) to tackle the issue of recording attendance for persons listed in a MySQL database. I am using this structure because I am attempting to create a web page that will handle a form and then display it again. Larry mentions this function on page 86. I plan to use input type="checkbox" name="checkbox[]" value="full_name". The value part is where I am having trouble. I want to select a person's name from a table in the database so that the name will appear on the form on the same line with the checkbox. The page is in two parts, the f
  9. I have an HTML table generated by PHP querying from MySQL table. <table> <tr> <th>Sl</th> <th>ID</th> <th>Article Name</th> <th>Publish Status</th> </tr> <?php $i = 1; foreach ($obj->showAllFromTable('pattern') as $pattern) { extract($pattern); ?> <tr> <td><?php echo $i++; ?></td> <td><?php echo $id; ?></td> <td><?php echo $patte
  10. Hello all, I am enjoying this book, and have had all success deploying the chapter 3 department select menu scripts on my local environment. When i try to implement the same when using a bootstrap style website, where the pages are outputted through the index.php file: https://mysite.com/index.php?page=dept_form&did=1 I run into problems. In your book on chapter 3 your dept.js file has the code pulling from (get, dept_results_ajax.php?did=' + encode...). Because of the bootstrap style site I am using will this be different? Also, does it matter if using https opposed to htt
  11. I am almost finished the book, and I am not totally clear on how to use the $page_title variable that appears throughout the book, do we have to include the following code in the title tag of each php script in order to use $page_title. <?php echo $page_title; ?>. In most of the examples in this book the $page_title variable is used in the script without showing the code used in the title tag. Also since the $page_title variable appears below the title tag when I load the php script in my browser I get an error message saying that $page_title isn't a valid variable. Can someone expl
  12. I am attempting to develop a PHP script to record presence at an event for those persons in a mysql table Persons. I am attempting to use checkboxes to indicate who was present. Here is the script as currently written: <?php # Script require ('includes/mysqli_connect.php'); if(isset($_POST['checkbox'])) {$checkbox = $_POST['checkbox']; if(isset($_POST['activate'])?$activate = $_POST["activate"]:$deactivate = $_POST["deactivate"]); $id = "('" . implode( "','", $checkbox ) . "');" ; echo $id; $q="UPDATE Persons SET present = '".(isset($activate)?'Y':'N')."' WHERE id IN $id" ; $r = mys
  13. Can anyone provide me with a simple solution to the Pursue question in chapter 18, create a last_login field and make it so that a user can see how long it has been since they last logged in. thanks Graham
  14. Hi everyone. I've done everything I could think of to get Script 11.8 to work, but I keep getting the error message 'The username and password you entered do not match those on file'. The users.txt is where it should be (because it worked fine for register.php) and the script is almost exactly how it is in the book. I'm using the same user names and passwords as well. Is this happening because I'm on a Mac? Oh, I'm on PHP 5.3.6 and use XAMPP. <?php // Script 11.8 - login.php $file = '../users/users.txt'; if ($_SERVER['REQUEST_METHOD'] == 'POST') { // Handle the form. $loggedin = F
  15. hey everybody, i have a request here,i'm a newbie in which called php and mysql.. i have finished the HTML of my website and now i want to implement a sidebar for Most Popular Posts.. i'masking if u can afford me with a tutorial from the scratch to build my sidebar? plz? thanks in advance
  16. 2 problems with my code, the filter_var doesn't seem to work at all for any of my variables, also the spam_scrubber function doesn't seem to clean \r, and \n, when put in my contact form, it cleans all the rest though just fine. <?php // resources.php function spam_scrubber($value){ $very_bad = array('to:', 'cc:', 'bcc:', 'content-type:', 'mime-version:', 'multipart-mixed:', 'content-transfer-encoding:'); foreach ($very_bad as $v){ if (stripos($value, $v) !== false) return ''; } $value = str_replace(array( "\r", "\n", "%0a", "%0d"), ' ', $value); return trim($value); }//end o
  17. I want to create a contact form that has an email field where the user can't enter any white space in the field, for example: test@ex ample.com I am using a spam scrubbing function taught to us in the book to clean user inputs. I am using my variable like so. $email = strip_tags($scrubbed['email']); how can I add something like this $email = preg_replace('/\s+/', '', $email); to the existing $email = strip_tags($scrubbed['email']); I tried $email = (preg_replace('/\s+/', '', $email)(strip_tags($scrubbed['email']))); and all sorts of variations to that. it doesn't work.
  18. Hi, I need some help with a php application. I want to write simple online scheduling/appointment application with PHP and MySQL. I am not sure how to begin. Basically these are what the application would allow: USERS : - to log in as member - choose the person (advisors) they want to make an appointment with - pick a date and time from available time slot For example, Feb 1, 2014, 8:00AM- 8:30AM - Submit the date to advisor (email confirmation) ADVISORS - to log in as an admin - set up their schedules (available date and time). - there are several advisors, each has seperate
  19. I think my PEAR install is working and got the phpDocumentor installed but now get an error using it. "phpDocumentor.EMERGENCY: phpDocumentor detected that a requirement is missing in your system setup: The XSL writer was unable to find your XSLTProcessor: please check if you have installed the PHP XSL extension or XSLC ache extention." I have a windows 7 home premium 64 bit laptop with WAMP. My Wamp 2.2 settings are Apache: 2.2.22, PHP: 5.3.13, and MySQL: 5.5.24. I checked in my php.ini file from the wamp icon in my toolbar and it has the XSL extension on. What can I do now to get the
  20. Hi, After following Larry's book and getting the helps from this forum, I finally get my first web project done. It has 4k product items and 1.5k users in the database. The website is fully functional in localhost. I carefully checked and killed all of bugs. Seems everything running without problem. So I need to looking into how to upload this project to the web host. I have never done anything like that before, so I am not sure what thing will go wrong and what things will screw up the project I have spent a year into. Please give some idea of what to avoid. I assume I just exp
  21. Hi, Here the case is when user clicks a link, if he/she is not signed in yet, then he/she will be redirected to a login page. After the user successfully logged in, user should be redirected to the page url he/she intended to visit. I have no clue how to do this, but I found article online suggesting to store url into $_SESSION array before user has logged in. So I tried to store what url visitor clicked into $_SESSION['targetPage'], then redirect to login page. When user does a successful login, then $_SESSION ['targetPage'] is plugged into header function to redirect user back to th
  22. Hello, I have been having trouble with this for quite some time I have tired to narrow it down the best I can. I able to complete the registration process, I went and check the sql database all fields have been filled. I think that the activation page cannot access the database to remove the active code. I tried to print or echo out the query value with echo "<p>Q: $q</p>" or print "<p>Q: $q</p>" all I see on the screen is "Q:" When I click the link from my email it doesn't seem to fail as it does not redirect me to index.php. I also do not get any er
  23. HI, again I tried to use the array looping technique from PHP advance book (chapter 1) on my project to output products category into <ul><li> list then apply superfish menu on them. But the output created extra <a>element which slightly messed up the superfish menu. I double check the make_list() function script and I can't tell why the extra <a> tabs are created. the code: <?php require ('includes/config.inc.php'); require (MYSQL); function make_list($parent) { global $cat_list; echo '<ul>'; foreach($parent as $catid => $c_list){
  24. Hi, Larry In your Modern Javascript book, there is a dynamic select menu for picking operation system. Is that possible to create a similar menu in php? or manipulate that menu with php. I have 2 tables table 1: category contains category_id, category table 2: category_categories contains id, category_id, parent_id so I want to create a primary menu to have all categories that the parent_id equals to 0 (the top), when user select a category from primary menu, the subcategory menu become selectable and load the subcategory under the primary category that user has sele
  25. Hello, I tried to insert multiple image into image table using a foreach loop. The images insertion have returned no problem. But I wanted to catch the image_id of each insert and putted them into an array ($iid). Here is problem, no matter what I tried, the result always return 2 separated array: Array([0]=>9193) Array([1]=>9194). Is there anyway to solve this problem? I want Array([0]=>9193 [1]=>9194). Thank you all!. CODE: // query for media $query = 'INSERT INTO media (file_title, file_mimetype, file_type, file_url, file_url_thumb, file_is_produ
  • Create New...