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.

Siege84

Members
  • Joined

  • Last visited

  1. I've been working with Adobe Illustrator for about 6 months, trying to learn to create interesting designs and graphics, but now I'm starting to create an online portfolio and I find when I save a file "for the Web" it looks pixelated and blurry around the edges. I've tried saving at 100% quality in both .png and .jpg format and I've had very little success with it. I was wondering if someone could help me with this issue.
  2. Another solution would be to replace: <?php echo $fill_block; ?> With: <?= isset($fill_block) ? $fill_block : ''; ?>
  3. I'm trying to create a form in ASP.NET that allows a user to create a form. After creating it, I want to save variables to a database and allow others to use that form, however that's one step ahead of where I'm currently at. The code I have works, so far, to create a text box (and the associated panel and label controls) in the AJAX UpdatePanel. The problem comes when I click the button a second time, the first panel, label and text box are removed and the new one created takes its place. How do I prevent this from happening? As you can see from the code below, I tried adding a new object to a List and then just displaying all of the items in that list, but it didn't work. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Form.aspx.cs" Inherits="DynamicForm.Form" %> <!DOCTYPE html> <html> <head runat="server"> <title>Form created by a user</title> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="btnNewTextBox" EventName="Click" /> </Triggers> </asp:UpdatePanel> <p> <asp:Label ID="Label1" runat="server" Text="Field Name:"></asp:Label> <br /> <asp:TextBox ID="txtName" runat="server"></asp:TextBox> </p> <p> <asp:Button ID="btnNewTextBox" runat="server" Text="New Text Box" onclick="btnNewTextBox_Click" /> </p> </form> </body> </html> using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace DynamicForm { public partial class Form : System.Web.UI.Page { UpdatePanel updatePanel; List<Control> controls; protected void Page_Load(object sender, EventArgs e) { updatePanel = UpdatePanel1; controls = new List<Control>(); } protected void btnNewTextBox_Click(object sender, EventArgs e) { Panel panel = new Panel(); panel.BorderWidth = 1; panel.BorderStyle = BorderStyle.Solid; Label name = new Label(); name.Text = txtName.Text; panel.Controls.Add(name); TextBox control = new TextBox(); control.ID = "txt" + txtName.Text; control.Text = control.ID; panel.Controls.Add(control); controls.Add(panel); ShowForm(); } private void ShowForm() { foreach (Control control in controls) updatePanel.ContentTemplateContainer.Controls.Add(control); } } }
  4. Siege84 replied to Siege84's topic in Server Side
    No, that "$this->database" variable was being used elsewhere and frequently within that same child class during the same page being processed as well as others. The problem seemed to be solved by using "closeCursor();" on the previous use of that PDO object.
  5. Siege84 replied to Siege84's topic in Server Side
    The code I posted above is the precise code I'm currently using in my project which is not working properly. When I use "$db->prepare( .... );" instead of "$this->database->prepare( ... );" on that fourth line of code, it will work... however I'd like to use "$this->database" instead of "$db" for consistency purposes. Throughout this project, I've used the protected variable "$this->database" throughout my project and for some reason in this one instance it simply isn't working. No error is being produced (I checked using errorCode and var_dump) however it always returns an empty array when using "$this->database" for some reason.
  6. Siege84 posted a topic in Server Side
    In the project I'm working on currently, I'm having an odd problem. I have a PDO object, stored in a parent class as a protected variable which is used by many child classes. I use it frequently, including several times in the current child class that I'm modifying. All of a sudden, within this class I'm writing, it stopped working. I checked the stored procedure it's calling, and it works fine. I then checked the PHP code using it, by creating a new PDO object and replacing the one I normally used. // $this->database = new PDO( DB_DSN, DB_USER, DB_PASS ); private function getPermissionsList( $id ) { $db = new PDO( DB_DSN, DB_USER, DB_PASS ); $query = $this->database->prepare( "CALL spGetPermissionsList(:id);" ); $query->bindParam( ':id', $id, PDO::PARAM_INT ); $query->execute(); $data = array(); while ( $row = $query->fetch() ) $data[ $row['id'] ] = ucfirst( $row['permission'] ); return $data; } "$this->database" is the protected variable which stops working... if I replace it with the local variable "$db" as shown above, and use it on the line where the method "prepare" is called, everything works as intended. When using the inherited "$this->database" PDO object, the query simply returns an empty array. I've tried using "echo $query->errorCode();" to find out which error was being produced, and it resulted with "00000" being printed. As I've said, I used this exact method many times throughout my project and this is the first time it has ever failed so inexplicably. Does anyone know a reason why a PDO object would simply stop working like this? Any help would be greatly appreciated.
  7. I'm not at all familiar with reflection yet. However, after seeing your post I adjusted my code to the following and it seems to work as intended. Just a small change to the parent constructor: <? abstract class ParentClass { protected function __construct( $var=null ) { if ( method_exists($this, $var) && is_callable( array($this, $var)) ) $this->$var(); } } class ChildClass extends ParentClass { public function __construct( $var=null ) { parent::__construct( $var ); } public function testing() { echo "Testing exists"; } } $one = new ChildClass(); $two = new ChildClass("testing");
  8. My question (or problem) exists with trying to find if a child class has access to a method of a certain name. I've done some google searching on it, and one solution I've found is simply passing the instance of the child class to the parent but I was wondering if there was a way to check in a more direct manner. <? abstract class ParentClass { protected function __construct( $var=null ) { if ($var == "testing") { // 1. check if child has method "testing" // 2. call "testing" } } } class ChildClass extends ParentClass { public function __construct( $var=null ) { parent::__construct( $var ); } public function testing() { echo "Testing exists"; } } $child = new ChildClass("testing");
  9. Really stupid error based on some inexperience working with a live server on my part. I exported my local database to an .sql file and imported it to my live server, unfortunately (for some reason I still don't know), it did not port all of my stored procedures for the associated database. My PHP script was running these stored procedures in the functions handling AJAX call. I've described my problem (and solution) here in case anyone else comes across a similar error, hopefully it saves them some time.
  10. I created a web page which makes an ajax call to a php page every time a value in an input box changes. In addition to having that php script check the value in the input box for invalid characters (with preg) and other forms of validation, I also have it making a call to a database to see if the value is already in that database. While everything works perfectly locally, when I upload it to my server the whole AJAX call still functions perfectly except the one clause for checking the database. Obviously I thought it may be an error with my PDO statements, so I copied them into a new file tried querying the database using the same object and it worked perfectly (although I didn't use ajax to make the call on the test file). This is the first time I've tried to take a project of mine to a live server. Has anyone else experienced a similar issue and solved it? It's very odd because I know the AJAX call is working because the other validation is fine, and I know my PDO statements are working fine because of the test file, but for some reason the combination of the 2 won't seem to work (except locally). Thanks for anyone who took the time to read this!
  11. Yeah definitely. When I started learning Photoshop, I guess I was assuming it was an all-in-one tool for image creation. I do find it very useful for setting up layouts for websites, and still use it primarily for that. I'm not loving it when it comes to trying to create a new picture from scratch though and I think Illustrator will scratch that itch if/when I am able to learn to use it well. Still looking for video tutorials, if anyone has any tips and/or links it would be greatly appreciated!
  12. Yeah, I do have one book but for some reason I find myself using them mostly for reference then I do initial learning. I've found classrooms or video tutorials help lay the foundations for learning quite well in my case. I did look for some good books, but the only one I could find was the official book by Adobe, or something like that. It isn't great. I do agree that Illustrator seems awesome. I like Photoshop as well, but the more I learn about Illustrator (mostly been seeing what it's capable of, not how to use it yet) it seems a lot cleaner.
  13. I started as a programmer several years ago, and then began working as a PHP Web Developer. In the past year, I've tried to learn front-end web design. I thought Photoshop was the right way to go initially. I am by no means a Photoshop expert, but I am fairly well versed in many of it's primary features. Now, I'd really like to learn Illustrator as well. Generally when learning, I really prefer a series video tutorial to introduce myself to learning features or technique in any technical aspect. Usually, if those are not sufficient, I then look for articles online to fill in the blanks. However, my initial search for a series of video tutorials to learn Illustrator has not been very successful. I've found one series which looks like it could be informative on TutsPlus but it requires a paid subscription to access it. I just thought I'd ask here if anyone had any suggestions for a good series which teaches how to use Illustrator tools and techniques rather than teaching how to reproduce one specific image. Any advice would be greatly appreciated. Thank you!
  14.    Siege84 reacted to a post in a topic: CSS is forcing nesting with float
  15. Ah thank you very much. I have had a similar problem recently so I should have known better. Thank you very much.
  16. I wasn't inclined to post my whole code since it would produce a lot of clutter, but the problem I'm having is with this basic section. When I tried to apply a background color to the <section>, it would also apply to the nav, and I also realized that the top-padding of the section didn't appear to be filling out properly. I assume it's because I use a display of inline-block and a float: left to style elements within the <nav> the way I wanted it. Assuming I provided all of the relevant information and my problem is being conveyed accurately, is there a way to keep these separate? I want to style the <nav> independently of the <section>. HTML <nav> <ul> <li><a href="1">Page 1</a></li> <li><a href="2">Page 2</a></li> <li><a href="3">Page 3</a></li> <li><a href="4">Page 4</a></li> <li><a href="5">Page 5</a></li> </ul> </nav> <section> Lorem Ipsum.... </section> CSS nav { background: #555555; } nav ul { list-style: none; margin: 0; padding: 0; } nav ul li { display: inline-block; float: left; } section { background: #DDDDDD; padding: 50px; }

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.