Jump to content

shadowcaster

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.underconstruction.no.way

Profile Information

  • Gender
    Not Telling
  • Location
    UK

shadowcaster's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi. I have a table with the structure: CREATE TABLE otherpayments ( `advert_id` INT(11) NOT NULL AUTO_INCREMENT, `cheque` INT(1) NOT NULL, `postalorder` INT(1) NOT NULL, `paypal` INT(1) NOT NULL, `other` INT(1) NOT NULL, PRIMARY KEY(`advertentie_id`) ); Is it possible to remove the AUTO_INCREMENT from the advert_id field and how would I go about doing that? Thanks in advance.
  2. Hello guys. I have a simple form on a page and I want to copy some field's data from one set to another, from the address field (a1) to another address field (pa1). Here is the JavaScript I'm using: <script language="JavaScript1.2" type="text/JavaScript"> function copyOver(){ document.form.pa1.value = document.form.a1.value; document.form.pa2.value = document.form.a2.value; document.form.pa3.value = document.form.a3.value; }</script> and the html: <form name="form" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <tr><td width="260" valign="top">Current Address <font color="#FF0000">*</font> </td> <td width="340"><input type="text" name="a1" style="width: 200;" class="contact" maxlength="50"><br> <input type="text" name="a2" style="width: 200;" class="contact" maxlength="40"><br> <input type="text" name="a3" style="width: 200;" class="contact" maxlength="30"></td> <td> </td></tr> <tr><td width="260" valign="top">Permanent Address <font color="#FF0000">*</font> </td> <td width="340"><input type="text" name="pa1" style="width: 200;" class="contact" maxlength="50"><br> <input type="text" name="pa2" style="width: 200;" class="contact" maxlength="40"><br> <input type="text" name="pa3" style="width: 200;" class="contact" maxlength="30"></td> <td width="100" valign="top"><input name="copyOver" type="button" onClick="copyOver();" value="Same As Current"></td></tr> When I click the button it doesn't do anything
  3. That worked brilliantly! Thank you so much!!  :D
  4. Hi everyone. I have a search engine on my website that I wish to know what the most popular searches are. I would like to know if the mysql code below is the correct way of doing a 'most-popular-searches' query. Here is the code including using PHP: [code] //Find every unique search $queryA = mysql_query("SELECT DISTINCT(searches) FROM search_table"); //create temporary table to hold search and number of times searched $queryB = mysql_query("CREATE TEMPORARY TABLE searches_count (searches VARCHAR(255), count INT);"); //loop through the distinct searches while ($row = mysql_fetch_array($queryA)){         //count how many times each search is in table $queryC = mysql_query("SELECT COUNT(searches) FROM search_table WHERE searches='".$row[0]."'");         //insert results into temporary table (extracts count from queryC) while($row2 = mysql_fetch_array($queryC)){ mysql_query("INSERT INTO searches_count VALUES('$row[0]','[$row2[0]');"); } } //sort and output the most popular searches $results = mysql_query("SELECT * FROM searches_count ORDER BY count"); while($row = mysql_fetch_array($results)){ print $row[0]. " " .$row[1]. "<br>\n"; } [/code] Am I doing this correctly or is there an easier way?
  5. That isn't the problem. Ahhh, I quit! I'll just settle with a standalone page.
  6. Are you trying to change a framed page? or open it in a new window?
  7. Thanks mate. Lol. That was simple.
  8. Hello. I have a simple form and want it to open in a new window to the location with the uri "http://www.google.com/search?hl=en&q=" + search I've get javascript errors with the current code. And when I click submit it opens the same file but appends the 'search' uri to be like this example.html?search=Search&clicked=Search... [code] <html> <head>         <link type="text/css" rel="stylesheet" href="rounded.css" media="screen" />         <!--[if IE]>         <style type="text/css">         body {margin:0px 0px 0px 0px; padding:0px;}         .container {width:250px; background;transparent;}         .textbox   {padding-left:15px; padding-top:0px;}         .submit       {padding-left:25px; padding-top:4px;} div.rounded h4 {display: block; align:center; color:black; } div.rounded h4:first-letter {padding: .3em 0 0 24px;background: transparent url(tlc_24_ddffff_60b0bf.gif) no-repeat top left} div.rounded p {background-image:url('bga.gif');}</style>         <![endif]-->         <script language="javascript" type="text/javascript">         do(){             var search = document.form1.search.value();             window.open("http://www.google.com/search?hl=en&q=" + search);         }         </script> </head> <body> <table border="0" width="255"> <tr><td> <div class="container">     <div class="rounded">     <h4>Google.com</h4>     <p>     <form method="get" name="form1" onsubmit="do();">     <input type="text" width="50" style="background:white; border:1px solid black; padding:3px;" name="search" value="Search..." onclick="document.form1.search.value('')" /><br />     <input style="background:black; color:white; margin-left:35px; padding-top:3px; margin-top:4px; margin-bottom:4px; font-weight:bold;" type="submit" value="Search..." name="clicked" /><br />     </p>     </div> </div> </td></tr> </table> </body> </html> [/code] Please help. I want it to work in firefox as well as IE. Thanks.
  9. Cheers guys but I found out what was wrong... I had to use $_POST[del] for each time I used the array in a process. If I assigned it to a local array like so: $del = $_POST[del]; then it would NOT make $del into the array with all the data within and it wouldn't work. I'm not sure why this happens but I learnt something new.
  10. Hi. I have a few HTML checkboxes that have the value of the id column of a table in the database - [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] <input type="checkbox" name="del[]" value="1" checked> //value 1 is to represent row 1 in the table <input type="checkbox" name="del[]" value="2" checked> <input type="checkbox" name="del[]" value="3" checked> <input type="checkbox" name="del[]" value="4" checked> another one of the checkboxes is: <input type="checkbox" name="seen[]" value="1"> //as with del, the value represents the row id in the table <input type="checkbox" name="seen[]" value="2"> <input type="checkbox" name="seen[]" value="3"> [/quote] But when I try to proccess these and get the array of values passed in the 'del' and 'seen' name it doesn't pass the array. Here is the PHP: [code] if (isset($_POST['submit'])){     $delete = addslashes($_POST[del]);     print_r($delete); //outputs 'Array' only     $notseen= addslashes($_POST[seen]);     print_r($notseen); //outputs nothing at all[/code] Where am I going wrong? Please help.
  11. Hello. I'm not sure if this is a newbie question but imagine I have two strings: [code] $string1 = "The quick brown brown fox jumps over the lazy dog."; $string2 = "The quick brown albino fox jumps over the groovy dog."; [/code] How would I compare the strings and then highlight the differences compared to $string1 so that the words albino and groovy stand out?
  12. Can you please give me an example. Do you mean like this?: [code] if (mysql_query("INSERT INTO searches VALUES('NULL, '$search','$date')")){   //do stuff }[/code] I haven't done that no.
×
×
  • 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.