Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CityWebConsultants

Members
  • Joined

  • Last visited

  1. I will assume that you have a "users" table that has fields similar to: user_id (int) first_name (varchar) last_name (varchar) email (varchar) password (varchar) When the user logs in you will run a query to authenticate them with a username and password. if the user is authenticated store the "user_id" in a session $_SESSION['user_id'] You can then look up the data for that user_id in your table any time you like by doing something a bit like this: $strSQL = "SELECT first_name, last_name, email FROM users WHERE user_id ='".$_SESSION['user_id']."'"; Don't forget to include session_start() at the top of your script.
  2. Zend Studio is worth a look it has some brilliant debugging features too.
  3. Please check if you are getting a forward slash ( / ) or a backward slash ( \ ). If you are getting a forward slash, then stripslashes() won't work use str_replace() to replace the offending character. If you are getting a backward slash then use stripslashes() as jamest recommends. Also have a read of this resource about the pro's and cons of magic quotes: http://uk3.php.net/manual/en/security.magicquotes.php
  4. Hi Luigie, I will asume that you downloaded the uncompressed site map? It's filename will be sitemap.xml. Use your FTP client to upload it to your web hosting. public_html is the place where you upload your index.html file, you can place sitemap.xml in the same directory (folder). If you have windows hosting it is likely to be wwwroot instead of public_html (linux hosting). Here are a few other tips: 1. Use a "crumb trail" as a visual clue to the user so they know where they are within your website. You can't always guarantee that visitors will land on your main page when they have been directed to your site via search engine or some other website. 2. Have a sitemap page (as well as a sitemap file) that contains links to all the other pages within your website. This will allow the likes of google to access all the pages on your site from just one page. Ensure that the sitemap page is included in your navigation. 3. Use robots.txt to tell robots which parts of your site you don't want them to look at. You can also use robots.txt to inform robots about your sitemap. (visit - http://www.robotstxt.org/orig.html ) An example of a robots.txt file: User-agent: * Sitemap: http://www.citywebconsultants.co.uk/sitemap.xml Disallow: /cgi-bin/ The User-agent identifies the robot. In the case of an asterisk it mean all User-agents. Sitemap: this is the URL of your sitemap Disallow: parts of your site you want the agent to leave alone Hope this helps.
  5. The following will work if the month is numeric: echo "<h2>".date("F",strtotime("December 2008 +".$messages['month']."months"))."<h2>";
  6. There are several reasons the main one being for clarity. The exctract funtion lends itself well to poor coding practice. When working on large projects with multiple developers you are likely to find yourself wondering where a variable has come from if 'extract' has been used. For example: $arrUsers = $this->getUsers(); extract($arrUsers); If ($admin) $this->displayAdminPanel; Where did $admin come from?
  7. Could also try http://www.php.net Loads of useful stuff there.
  8. Looping through an array like this should work: <?php //add some variable names to an array of variables $arrVariables[] = "strHello"; $arrVariables[] = "strTest"; for($iIndex = 0; $iIndex<count($arrVariables); $iIndex++) { //create the variables ${$arrVariables[$iIndex]} = "This variable is called ".$arrVariables[$iIndex]; } echo $strHello; echo $strTest; ?> The output should be: This variable is called strHello This variable is called strTest
  9. The array of months is currently creates a drop down containing the month name as text, and the month name as a value. If you view the generated code in a browser it will look like this: <select name ="month"> <option value ="January">January</option> etc.... </select> It would be better to create the drop down like this: <select name ="month"> <option value ="1">January</option> etc.... </select> The month number can be derived by using $key in your foreach loop. (see my previous post) If the month number is returned then you can work out the month name using date("F",strtotime("December 2008 +".$_POST['month']."months")); This uses the stringtotime function - great for calculating dates If the month selected was "March" then the value of $_POST['month'] would be 3. In the case of "March" then, the stringtotime function is calculating December 2008 + 3months $iMonth = $_POST['month']; // this should equal 3 if March is selected //to get the name of the month you could try this $strMonth = date("F",strtotime("December 2008 +".$_POST['month']."months"));//this should return March Try echoing this out when the form gets submitted: eg: echo $_POST['month']; echo date("F",strtotime("December 2008 +".$_POST['month']."months")); Hope this helps.
  10. Try changing your function so that the numeric value of the month ($key) is placed in the value attribute of the option element. eg. echo "<OPTION value='".$key."'> ".$value."</OPTION>"; To capture this value when the form is submitted use something like: $iMonth = $_POST['month']; //to get the name of the month you could try this $strMonth = date("F",strtotime("December 2008 +".$_POST['month']."months")); //then insert the values into your database...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.