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.

Monie

Members
  • Joined

  • Last visited

Everything posted by Monie

  1. Monie replied to eugenemdonaghy's topic in Frontend
    There should be no space between url and the parentheses. Here’s the corrected syntax: @import url("assets/bootstrap/css/bootstrap.min.css"); @import url("../assets/fonts/ionicons.min.css"); @import url("Footer-Basic.css"); @import url("Navigation-Clean.css"); @import url("links.css");
  2. The issue occurs because you are passing an array of headers into the mail() function, while the mail() function expects a string for the headers. You need to convert the headers array into a string before passing it to the function. Here’s how to fix it: <?php // Retrieve form data $name = $_POST['name']; $from = $_POST['email']; $subject = $_POST['subject']; $message = $_POST['message']; $to = 'info@geapellas.gr'; // Replace with your email // Build headers $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type: text/plain; charset=iso-8859-1" . "\r\n"; $headers .= "From: {$name} <{$from}>" . "\r\n"; // Send email mail($to, $subject, $message, $headers); // Optional: Redirect or show success message echo "Email sent successfully!"; die; ?> Key Changes: 1. Headers as a String: Instead of using an array for $headers, I concatenated the headers into a string, which is required by the mail() function. 2. Newline Characters (\r\n): Each header line is separated using \r\n, which is the standard for email headers.
  3. Hi, anybody here using Ngrok for hosting on own server? Currently, you need to run this two code from the ngrok.exe terminal in order to activate and open up the tunnel to your server: ngrok config add-authtoken 21WFrTHH68ULVWhxXM1TnU5MBw8Y_YYz6NB8utkRNd ngrok http http://localhost:8080 Is there any automation of a much more easy way to run this script especially after a machine restart? Thanks.
  4. Most of the page is hard coded. I'll later will create all the login page, registration page, session controller.. In the mean time, let me have a look at this getClicky things first. Thanks.
  5. I was thinking to update into my database when they click any file to download: <a href="file1.pdf" title="File 1" onclick="myFunction()">Download Me!</a> myFunction will later be the sql query.. UPDATE table_name SET column1 = value1, column2 = value2, ... WHERE condition; Will this slows down my web page? Is this the proper way to achieve my goal?
  6. Greetings, I have successfully implemented this script (PHP Directory Lister) into my workplace document management system. What I plan to do now is to add in a simple audit trail or audit log of user activity on that system: What file user download (time and date). Document their IP addess Login date and time Does any of you ever did this or can anybody share some idea where to go from here? Thanks.
  7. Thanks fisicx! Appreciate the sollution. It works flawlessly.
  8. Well, is there any other method other than the classic asp or html/css solution to achieve this?
  9. Hi, anybody here knows the simplest Classic ASP function to truncate a long text? Example: 1. This is a very long text. 2. This is a very... Text got truncated at certail length.
  10. Web designer world is an art! You should have at least an art mind to be a web designer. Some people were born with that gift and it makes it easy for them to express their ideas. Some people have to shape their own skills from scratch and soon become a good designer, sometimes failed. As for me, this is my step when I start venture into web designing world: Learn HTML (how to code with proper validation) Learn CSS (for layout, positioning stuff and avoiding the inline HTML stuff) Learn PHP (how to include common files, database connection, dynamic language) Learn PHOTOSHOP(this is the main aspect if you want to be a designer) Learn OPTIMIZING(HTML, PHP, CSS, IMAGES, JS) and lastly, Learn how to live like a WEB DESIGNER Good luck to you, You have a very long day ahead of you!
  11. Monie replied to Monie's topic in Server Side
    Well, I guess no one knows much about XML here. So I dig my very own research on this issue and managed to solve what it seems to be a big issue but actually a small one. Thanks anyway for the effort guys. Appreciate it!
  12. Monie replied to Monie's topic in Server Side
    Ok, after surfing for a few hours learning PXP-XML thingy, I managed to magically update my XML file with this PHP code using DOMDocument function: // --- Updating the XML File ------------------------------------------- // $xml = new DOMDocument(); $xml->load("../piecemaker.xml"); $root=$xml->documentElement; //find the tags that you want to update $tags = $root->getElementsByTagName('Image'); //find the tag with the id you want to update foreach ($tags as $tag) { if($tag->getAttribute("id") == "slide1") { //found the tag, now update the attribute $tag->setAttribute("Source", "newImageName.jpg"); $tag->setAttribute("Title", "newImageTitle"); } } //save the xml $xml->save("..piecemaker.xml"); The issue now is it removed some end tag in the xml file: // Original Structure <Contents> <Image id="1" Source="image/piecemaker1.jpg" Title="piecemaker1"></Image> </Contents> // After successfully update, the </Image> is missing <Contents> <Image id="1" Source="newImageName.jpg" Title="newImageTitle"> </Contents> I am wrong somewhere?
  13. I haven't look up at your INSERT issue yet but I have a perfect tutorial online for you to learn how to Delete multiple rows from mysql with checkbox
  14. Monie replied to Monie's topic in Server Side
    Almost like that, let me refresh everyone with what I want to achieve here. I have this XML file (sample.xml): <?xml version="1.0" encoding="utf-8"?> <Piecemaker> <Contents> <Image id="1" Source="image/piecemaker1.jpg" Title="piecemaker1"></Image> <Image id="2" Source="image/piecemaker2.jpg" Title="piecemaker2"></Image> <Image id="3" Source="image/piecemaker3.jpg" Title="piecemaker3"></Image> <Image id="4" Source="image/piecemaker4.jpg" Title="piecemaker4"></Image> </Contents> </Piecemaker> Its for a slider on my main page. I want to limit the number of slider to 4 image only. Nothing more. So, I created an HTML form (four upload form for each image) for me to insert the image and eventually update the XML file above with the newly uploaded image file name. So what I want the PHP to do is, right after the script to insert the image is successfully done, then a script will be executed to update the existing xml file with the newly uploaded image file name: upload-slider1.php Form Image:__________(Browse) Title:__________ Submit submit-image.php $new_file_name = $_POST['image']; $title = $_POST['title']; Upload image to directory here! .. . // Loop the XML file if image id == "1", or 2,3,4 set the Source to "&new_file_name" set the Title to "$title" update the XML file save document I have issue in the xml looping part and updating the existing xml attributes as well.
  15. Monie replied to Monie's topic in Server Side
    No one can help me with the XML thingy?
  16. Are you looking for CSS/HTML templates or CMS (Wordpress) perhaps? Maybe you can start here: Smashingmagazine.com
  17. Monie replied to Monie's topic in Server Side
    Ok, a change of knowledge just happen to me! What I want to do is actually to update my xml file (Source attributes of the Image node) to a newly uploaded image. Here is the code: <?xml version="1.0" encoding="utf-8"?> <Piecemaker> <Contents> <Image id="1" Source="image/piecemaker1.jpg" Title="piecemaker1"></Image> <Image id="2" Source="image/piecemaker2.jpg" Title="piecemaker2"></Image> <Image id="3" Source="image/piecemaker3.jpg" Title="piecemaker3"></Image> <Image id="4" Source="image/piecemaker4.jpg" Title="piecemaker4"></Image> </Contents> </Piecemaker> Ok, somewhere in my PHP image upload function, right after successfully uploaded the new m=image, I want to perform the xml update to update the xml Source attributes to the newly uploaded image name and Title. //PHP image upload function... //XML Update attributes I want to be able to loop to the xml files to find the selected ID and later change the Title attributes (or Source attributes): $id = 1; $new_title = "new title"; $xml = simplexml_load_file('file.xml'); foreach($xml->Piecemaker->Contents->Image as $linkGroup){ $linkGroup['Title'] = $new_title; break; } file_put_contents('file.xml', $xml->asXml()); Honestly, I dont even know if those xml code I right up there make sense or not! But that is the condition that I want to achieve. Consider that as a pseudocode Thanks.
  18. Monie replied to Monie's topic in Server Side
    Hi Jock, Can you tell me what does the code do? See, the XML file is static. So every time I upload an image, it will be stored in the same directory with the same file name (either piecemaker1.jpg, 2, 3, or 4). In order for the page slider page to fetch the new "piecemaker1.jpg" instead of the old cache version of "piecemaker1.jpg", I had to manually refresh the page a few times, which is a bad things to ask the user to refresh their browser! The code you gave me, is it in XML format of PHP? Do you have any better solution to my issue? Thanks Jock!
  19. Monie replied to Monie's topic in Server Side
    Ok forget about that! Neither will work with that approach. Sometimes the simplest solution that counts! Any idea how to add a document versioning on that XML files? <?xml version="1.0" encoding="utf-8"?> <Piecemaker> <Contents> <Image Source="image/piecemaker1.jpg<?php $now = time(); echo $now; ?>" Title="title1"></Image> <Image Source="image/piecemaker2.jpg<?php $now = time(); echo $now; ?>" Title="title2"></Image> <Image Source="image/piecemaker3.jpg<?php $now = time(); echo $now; ?>" Title="title3"></Image> <Image Source="image/piecemaker4.jpg<?php $now = time(); echo $now; ?>" Title="title4"></Image> </Contents> </Piecemaker> My idea is just to force the slider page (index.php) to get the latest image file from my XML file.
  20. Hi everyone! I have an XML file as below: <?xml version="1.0" encoding="utf-8"?> <Piecemaker> <Contents> <Image Source="image/piecemaker1.jpg" Title="title1"></Image> <Image Source="image/piecemaker2.jpg" Title="title2"></Image> <Image Source="image/piecemaker3.jpg" Title="title3"></Image> <Image Source="image/piecemaker4.jpg" Title="title4"></Image> </Contents> </Piecemaker> OK, so... its actually a Piecemaker 2 Slider. Now, I want PHP to update the XML file on the fly every time I upload a new image. So the new XML file will be like this: <?xml version="1.0" encoding="utf-8"?> <Piecemaker> <Contents> <Image Source="image/newImage1.jpg" Title="title1"></Image> <Image Source="image/newImage2.jpg" Title="title2"></Image> <Image Source="image/newImage3.jpg" Title="title3"></Image> <Image Source="image/newImage4.jpg" Title="title4"></Image> </Contents> </Piecemaker> Any idea? I failed to use SimpleXML to do this. Thanks.
  21. What about the Search function? By category, by month, year, etc...
  22. I read about those two function but I couldn't find how to make them work at the same time! Anyway, I found this custom function that uses both function and return a sanitize output: //Prepare MYSQL statement before saving to database function mysql_prep($value) { $magic_quotes_active = get_magic_quotes_gpc(); $new_enough_php = function_exists("mysql_real_escape_string"); // i.e. PHP >= v4.3.0 if($new_enough_php){ // PHP v4.3.0 or higher // undo any magic quote effects so mysql_real_escape_string can do the work if($magic_quotes_active) { $value = stripslashes( $value ); } $value = mysql_real_escape_string( $value ); } else { // before PHP v4.3.0 // if magic quotes aren't already on then add slashes manually if(!$magic_quotes_active) { $value = addslashes($value); } // if magic quotes are active, then the slashes already exist } return $value; } Use as: $post= mysql_prep($_POST['post']); It works!
  23. I think I really need to get this over in my head! I used mysql_real_escape_string() on all my variable just before inserting them into my database: $post= mysql_real_escape_string($_POST['post']); The variable post contained this string: Our company motto is 'We Live To Serve'. So inside my database, it will look like this: Our company motto is \'We Live To Serve\'. And when I echo the data to my HTML page, it will also display the all the \ thingy! The more I update the page, the more \ it will add to the string! Damn! Our company motto is \\\'We Live To Serve\\\'. How am I going to remove all this unwanted symbol on my echo stage?
  24. Monie replied to Monie's topic in Server Side
    The solution has been delivered. Now its the process of improving the administration of the website.

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.