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.

.ęνø.

Members
  • Joined

  • Last visited

Everything posted by .ęνø.

  1. .ęνø. replied to .ęνø.'s topic in Server Side
    Ok I've finally gotten back to this, lol. I think I'm really close to the working code right now. It's connecting to the database successfully, the $dyn_page variable is working fine, there aren't any typos, so I've put it up to something being wrong with the execution. Because it doesn't show anything. // in config.php $db_host = "***"; # host $db_name = "***"; # database name $db_user = "***"; # username $db_pass = "***"; # password // in functions.php $db_connect = mysql_connect($db_host,$db_user,$db_pass); mysql_select_db($db_name,$db_connect); $dyn_page = isset($_GET['page']) ? $_GET['page'] : "home"; function show_content(){ $query = sprintf("SELECT content FROM a_main WHERE short='$dyn_page'", mysql_real_escape_string($dyn_page)); $result = mysql_query($query); while ($row = mysql_fetch_assoc($result)) { echo $row['content']; } mysql_free_result($result); } // in index.php require_once("config.php"); require_once("functions.php"); show_content($dyn_page); Also, could someone confirm that this code is secure? Or could that be easily exploited?
  2. Ok, I don't usually add people I don't know, but I'll send you my address for the sake of helpin you out a bit if I can (lol).
  3. Still at 0 new messages. :\
  4. No prob, but I didn't get no PM.
  5. Your best bet is to try setting up reCAPTCHA. Best free anti-spam I've come across.
  6. First you need to set the variable it using $_GET. eg. If I wanted to use "page" for the variable like index.php?page=1 I would use this. What it does exactly, is it checks if the variable in the URL is set, if it is set then it sets the page variable to whatever you had in the URL. If it isn't set in the URL it automatically sets it to "home". $page = isset($_GET['page']) ? $_GET['page'] : "home"; Then you can use that variable to dynamically show content based on the variable you have in the URL. The way I do it is I set a function, which calls for the page "$page.php" in the "content" folder. If it exists it includes the file, if it doesn't exist it shows a 404 page. My final code is this: $page = isset($_GET['page']) ? $_GET['page'] : "home"; function show_content($page){ $file = file_exists("content/$page.php") ? "content/$page.php" : "content/404.php"; require_once($file); } And to call it all I have to do is place "show_content($page)" wherever I want it to show up, and then whenever I go to "www.example.com/index.php?page=example" it would look for "www.example.com/content/example.php" and if it can't find it, it would show "www.example.com/content/404.php", BUT if I went to "www.example.com/index.php" it would show "www.example.com/content/home.php". It shouldn't take you too much to modify that code to suit your needs. Good luck! EDIT: I might eventually make this into a proper tutorial, lol.
  7. Ok, I'll get back to you a bit later, I'm not at home at the moment.
  8. Sorry for the bump - but if you still need help on the ?id=# thing I can give you a hand.
  9. .ęνø. replied to Qwibble's topic in Frontend
    What I meant was you could use a blog script to get a similar outcome, but I was looking at the wrong thing anyway I just realized, lol.
  10. .ęνø. replied to Qwibble's topic in Frontend
    If I'm looking at the right thing, it's a php powered script. I'd say look for a blog script if you want something similar.
  11. .ęνø. replied to .ęνø.'s topic in Server Side
    Yeah I've done all the SQL stuff, I'll have another look at this tonight and see what I can do with it.
  12. .ęνø. replied to .ęνø.'s topic in Server Side
    It's not working for me. :\ Here's what I got: function new_show_content(){ $db = mysql_connect(*,*,*); // put the right values/variables in here $page = mysql_escape_string($_GET['page']); // prevents SQL injection attacks $resultSet = mysql_query("SELECT content FROM mydb.pages WHERE page='$page'",$db); // do query $firstRow = mysql_fetch_row($resultSet); // get the first row, or FALSE if no rows available if($firstRow === FALSE) { /* No result, so do the 404 */ include("content/404.php"); } else { $content = $firstRow[0]; // [0] is the first entry, so is the value of the 'content' field in this row echo $content; // } }
  13. .ęνø. replied to .ęνø.'s topic in Server Side
    That is pretty much correct. So if I were to go "www.example.com/index.php?page=home" it would call the database, then show table: pages, row: home, field: content. I'm really not sure about the row part. :s I'm not too good with SQL yet.
  14. .ęνø. posted a topic in Server Side
    First thing I'll say is, I'm very comfortable with HTML, an intermediate PHP coder, and a beginner at SQL. Now, this is what I have functioning at the moment: Function that reads the page= variable in the URL, and displays "content/$page.php", but if it doesn't exist, it shows a 404. $dyn_page = isset($_GET['page']) ? $_GET['page'] : "home"; function show_content($dyn_page){ $dyn_file = file_exists("content/$dyn_page.php") ? "content/$dyn_page.php" : "content/404.php"; require_once($dyn_file); } Now, this is what I want to have functioning: Function that reads the page= variable in the URL, and calls upon an SQL database to echo "database name > pages > $page > content", but if it doesn't exist, it shows a 404. And a way to show a textbox to edit "database name > pages > $page > content". Then a way to generate a table row showing "database name > pages > (all) > title". Sorry if that sounds a bit complicated, lol.

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.