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.

adsegzy

Members
  • Joined

  • Last visited

Reputation Activity

  1. Like
    This query should work:
     

    SELECT * FROM products WHERE status=1 ORDER BY package DESC, RAND()
  2. Like
    adsegzy got a reaction from NOCK in How to send Mail to email addresses in mysql table   
    Thanks Friend,
    I have sorted it out
  3. Like
    adsegzy got a reaction from Kaskhautual in How do I update a json file with mysql data using php   
    Hello friends,

    I am knowledgeable in PHP but not in JSON. But I have a JSON script that I want some of the data in it to be dynamic from mysql database. I have products page where all products are listed, on clicking any product it opens product detail page where this JSON script coordinates. Below is d JSON file
    My problems are how to make the below parts dynamic from mysql database (probably using PHP)

     
     
    Thanks
  4. Like
    mysql_query & mysqli_query are two similar but different functions. reading the W3 pages for each of the functions, there are some things you should notice
    1. how you connect is different.
    1a.) mysql_query needs to connect with a mysql_connenct command
    1b.) mysqli_query needs to connect with a mysqli_connect command
    2. what each function does and what they return are different
    2a.) mysql_query performs a query on the data base and returns a handle of the query
    2b.) mysqli_query performs a query against the data base(why different words on/against I don't know) and it will return -> For successful SELECT, SHOW, DESCRIBE, or EXPLAIN queries it will return a mysqli_result object. For other successful queries it will return TRUE. FALSE on failure

    so you see they are different and can not be used interchangeably without some kind of function to clamp the data in way that each function could use.
     
    for more information about the two functions you can read more at W3 on mysql_query and mysqli_query.
    Also if you want to get a bigger grasp on the mysqli functions and how it all works together W3 has a reference page for that as well.
     
    EDIT: corrected syntax and spelling errors and added some resource links.
  5. Like
    one way i think may work for you is to use Jquery onchange
     
    http://api.jquery.com/change/
     
    from there you can use Jquery Ajax to post the drop down value to another file containing your select query to fetch the correct states to populate your select drop down options
     
    http://api.jquery.com/jQuery.post/
     
    hope it helps
  6. Like
    You can do it with Ajax. Ajax is the fusion between Javascript and PHP, and maybe MySQL (if is really necesary).
     

    <html> <head> <script type="text/javascript" language="javascript" src="jquery.js"></script> <script type="text/javascript" language="javascript"> function cambiar(dato) { $.ajax({ url: "cambiarEcho.php", async:true, contentType: "application/x-www-form-urlencoded", data: "value="+dato, dataType: "html", global: true, cache: false, ifModified: false, processData:true, success: function(datos) { document.getElementById('lugarDeCambio').innerHTML=datos; }, timeout: 3000, type: "GET" }); } </script> </head> <body> <div id="lugarDeCambio"> <?php echo $eventoElegido; ?> </div> <select name="evento" onclick="cambiar(this.value)"> <option value="1">Option A</option> <option value="2">Option B</option> </select> </body> </html>
     
    cambiarEcho.php:
     

    switch($_GET['value']) { case 1: echo "Option A"; break; case 2: echo "Option B"; break; }
  7. Like
    Without refreshing the page, you'll need JavaScript.
     
    A quick/dirty method would be to code all your forms, and wrap them in their own container, like so;
     

    <div id="wedding-form" class="hidden-form"> <form action="" method="post"> <input type="text" name="flower_colour" value="Colour" /> <input type="text" name="surname" value="Surname" /> </form> </div> <div id="birthday-form" class="hidden-form"> <form action="" method="post"> <input type="text" name="age" value="Age" /> <input type="text" name="surname" value="Surname" /> </form> </div> <!-- ... etc. -->
     
    Then listen to the Event Type 'change' event, and handle it. Something like:
     

    $(document).ready(function(){ $("#event-type").change(function(){ switch ($(this).val().toLowercase()){ case 'wedding': $("#wedding-form").show(); break; case 'birthday': $("#birthday-form").show(); break; default: alert("Invalid choice!"); break; } }); //Hide all forms on page load $(".hidden-form").hide(); });
     
    You'll need to use something like this for the Event Type HTML:
     

    <select name="event_type" id="event-type"> <option value="Wedding">Wedding</option> <option value="Birthday">Birthday</option> </select>
     
    And make sure you include jQuery, too.
     
    Edit: I've just written this out on the forum so there may be bugs.
  8. Like
    you want dolphin social network script (http://www.boonex.com/dolphin)... the source is open source which is a massive help
  9. Like
    BuddyPress for wordpress...
     
    and your doing this as a school project? damn i never did anything like this
  10. Like
    adsegzy reacted to Cabbage in apostrophe problem in my form field   
    Ensure that magic quotes is turned off in your PHP config, they're not as evil as everybody makes them out to be but it's easier to find problems if they're off as you won't get slashes being added and taken away seemingly "magically".
     
    Personally (among other things) I make my SQL queries safe (and avoid the headache with slashes) by using something similar to the following.
     
    Inserting to a database

    $dbVar = addslashes($var);
     
    Retrieving from a database

    echo stripslashes($dbVar);
    Try to limit what users can enter into forms too, lock it down where possible and never rely on client-side validation.
  11. Like
    adsegzy reacted to webdeveloper93 in apostrophe problem in my form field   
    When u display it from the database try running it through stripslashes or when displaying it try this
     

    $variable = str_replace("/","",$row['something']);
    EDIT: also are u sure its forward slashes ur getting and not back slashes i've never got forward slashes before but anyways if its backslashes just change the code above to,
    $variable = str_replace("\","",$row['something']);
  12. Like
    adsegzy reacted to j05hr in apostrophe problem in my form field   
    You can use str_replace in your code so you would do something like
     

    $variable = str_replace (",", "", $_POST['whatever']);
     
    There might be a better way to do it than the way I have done it as I'm no pro with PHP myself (Assuming it is PHP you are doing it in)
     
    Here it is in the PHP manual
     
    http://php.net/manual/en/function.str-replace.php
  13. Like
    adsegzy reacted to Jay Gilford in Numeric Directory Search problem   
    $sql = mysql_query("SELECT * FROM $com_name WHERE com_name REGEXP '^[0-9]'");
  14. Like
    adsegzy reacted to Jock in problem with table in my php mail   
    You're probably sending it as plain text.
  15. Like
    http://www.tech-recipes.com/rx/1492/php-rename-or-move-a-file-on-the-server/
  16. Like
    adsegzy reacted to Tangled Frog in resize image problem   
    Hi there,
     
    You might like to try using something like this instead, it should do the trick if you're using PHP 5:
     

    $originalImage = $_FILES['image']['tmp_name']; $src = imagecreatefromjpeg($originalImage); list($width,$height) = getimagesize($originalImage); $ratio = $width/$height; if ($width > $height) {if ($width > 300) {$new_height = 300 / $ratio; $new_width = 300;} else {$new_height = $height; $new_width = $width;}} else {if ($height > 300) {$new_width = 300 * $ratio; $new_height = 300;} else {$new_height = $height; $new_width = $width;}} $target = "upload/image.jpg"; $tmp = imagecreatetruecolor($new_width,$new_height); imagecopyresampled($tmp,$src,0,0,0,0,$new_width,$new_height,$width,$height); imagejpeg($tmp,$target,100);
     
    This will resize your image to a maximum of 300px while retaining the original dimensions.
     
    If you're still having problems the manual for GD library is very helpful and not too hard to understand.
     
    Hope it works out ok!
     
    Kirsty
  17. Like
    adsegzy reacted to zed in resize image problem   
    or use timthumb? http://www.binarymoon.co.uk/projects/timthumb/
     
    works a treat.
  18. Like
    adsegzy reacted to Ashley Byrom in How to echo out 3 column table   
    You can put any HTML in an echo statement so long as you escape any funky characters...
     

    <table> <tr><td>Hello 1</td></tr> <tr><td>Hello 2 </td></tr> <tr><td>Hello 2</td></tr> </table>
     
    Becomes
     

    <?PHP echo "<table> <tr><td>Hello 1</td></tr> <tr><td>Hello 2 </td></tr> <tr><td>Hello 2</td></tr> </table>";
     
    Make sure you put a \ before any double quotes in your HTML to escape them
  19. Like
    adsegzy reacted to empek in How to echo out 3 column table   
  20. Like
    adsegzy reacted to dt17 in How to echo out 3 column table   
    lol'd
  21. Like
    adsegzy reacted to empek in How to echo out 3 column table   
    Here's a link to a tutorial I wrote for you.
  22. Like
    adsegzy reacted to Lev in different style for different hyperlinks   
    You also can use it:

    <style type="text/css"> a {color: #3366FF;} a:hover {color:#FFCC66} .red a {color: #FFF; background: #F00;} .red a:hover {color: #00F; background: #F00;} </style> <div>It is a <a href="">Hyperlink</a></div> <div class="red">It is a <a href="">Hyperlink</a>. It is a <a href="">Hyperlink</a>.</div>
  23. Like
    adsegzy reacted to andy9l in different style for different hyperlinks   
    CSS:

    /* For hyperlinks without background */ a, a:visited{ color: blue; /* Colour of hyperlink text */ } a:hover, a:visited:hover{ color: red; /* Colour of hovered text */ } /* For hyperlinks with background */ a.bg, a.bg:visited{ color: blue; /* Colour of hyperlink text */ background: red; /* Colour of background */ } a.bg:hover, a.bg:visited:hover{ color: red; /* Colour of hovered text */ background: blue; /* Colour of hovered background */ }
     
    HTML

    <a href="#" title="Hyperlink title">This hyperlink will not have a background</a> <a href="#" title="Hyperlink title" class="bg">This hyperlink will have a background</a>
     
    The colours are horrible, but you get the idea
  24. Like
    adsegzy reacted to Lev in how do i make a cell to be a link   
    EZest way is:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" /> <title>Untitled Document</title> </head> <body> <script> function lnk(param) { window.location.href = "http://www.yourSite.name/" + param; } </script> <table width="200" height="128" border="0" cellpadding="5" cellspacing="0"> <tr> <td onclick="lnk('home')">Home</td> </tr> <tr> <td onclick="lnk('about')">Abour Us</td> </tr> <tr> <td onclick="lnk('contact')">Contact</td> </tr> </table> </body> </html>
     
    But esteemed Connectu_C is dnmnd right — it is a thousand times better to use UL instead of TABLE to create CSS menu.
  25. Like
    adsegzy reacted to webdeveloper93 in problem with my text area field   
    Try using n12br();

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.