Jump to content

Search the Community

Showing results for tags 'new pages submit php sql'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hi everybody, I'm starting with PHP and Mysql, so it's getting diffictul at this poinf for me and i'm looking for a bit of help =). I've created a chained menu using php and a database, following this tutorial: http://www.yourinspirationweb.com/en/how-to-create-chained-select-with-php-and-jquery/ The frist table content a list of categories like : CREATE TABLE IF NOT EXISTS `chainmenu_categories` ( `id_cat` int(4) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(40) NOT NULL, PRIMARY KEY (`id_cat`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ; My second table, the type, like : CREATE TABLE IF NOT EXISTS `type` ( `id_type` int(4) unsigned NOT NULL AUTO_INCREMENT, `id_cat` int(4) unsigned NOT NULL, `name` varchar(40) NOT NULL, `destination` varchar(40) NOT NULL, PRIMARY KEY (`id_type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; I managed, once cliking on submit, to redirect to an other page by that in my select.php: var result = $("select#type option:selected").html(); $("#select_form").submit(function( event ) { var the_url = $("#type").val(); window.location = the_url; event.preventDefault(); }); and adding this on my select.class.php public function ShowCategory() { $sql = "SELECT * FROM chainmenu_categories"; $res = mysql_query($sql,$this->conn); $category = '<option value="0">choose...</option>'; while($row = mysql_fetch_array($res)) { $category .= '<option value="' . $row['id_cat'] . $row['destination']. '">' . $row['name'] . '</option>'; } return $category; } So now it redirect each time to a different page depending of the option choose from the menu, like: http://mydomain.com//3 or http://mydomain.com//4 or http://mydomain.com//5 etc etc But as the page doesnt exist, it redirect each time to a dead link, Is anybody can give me a help to create these pages from the chained menu ( or have some highlite) ? and If possiblles, some pointer to create the admin interface to allow an admin to add the pages / chained menu ? I've been trying to start with something which look like: <?php require('db_config.php'); $stmt = $db->prepare('SELECT id_type, name FROM type WHERE id_cat=$_POST[id]'); $stmt->execute(array(':id_cat' => $_GET['name'])); $row = $stmt->fetch(); but dont know if i'm in the good way at all, I' just so confused ! Thank you in advance for your recommandatiosn guys !!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.