Jump to content

robi_7

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

robi_7's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks GuiltyGear, your code works
  2. Hi Guys, Need help writing a regular expression to match '&Itemid=457' (no quotes, there can by any value for Itemid) for further use in preg_replace() function. Actually need to find those items in html code and remove them. It must be easy. I'm just not familiar with regex. Any help would be appreciated.
  3. First of all excuse me if this topic is inappropriate in this forum. But I think it's rather a PHP problem. I can't figure out multiple duplicate database records on submitting a form. The database table have two columns: the first one 'Id' with AUTO_INCREMENT and the second one 'Name'. Here's the php code for database insertion and the form: ------------------------------------------------------------------ <?php if($_GET['add_name']){ $host = *******; $user = *******'; $pass = *******; $db = *******; $con = mysql_connect($host,$user,$pass) or die; mysql_select_db($db,$con); $name = $_GET['add_name']; $sql = "INSERT INTO names (Name) VALUES ('$name')"; mysql_query($sql); } ?> <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="GET"> Your Name: <input name="add_name" type="text" /> <input type="submit" value="Submit" /> </form> ------------------------------------------------------------------ After submitting the form to itself once I have multiple Name entries with different Ids. The curious thing is that with Chrome browser I get two duplicate records, with Mozilla - three of them. Seems like mysql_query runs multiple times. It works fine when submitting the form to a separate script and not to itself. Do I miss something? It must be very basic.
×
×
  • 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.