Jump to content

khr2003

Members
  • Posts

    112
  • Joined

  • Last visited

    Never

Posts posted by khr2003

  1. I am not sure what you are trying to achieve in your code. Are you trying to make input names as an array so when data is posted you will loop through them and insert them accordingly?

     

    if that is that is case then I believe all you have to do is to make the input filed name like this:

    <input name="FieldName[]" type="text" value="any value">

     

    not the [] at the end of the name of the filed. this will convert the name into an array so when your data is posted you would have:

    FieldName0

    FieldName1

    FieldName2

    .. etc

     

    hope this helps

  2. it is a good idea to put your code between

     

    bbcode tags so it is readable.

     

    Also, since it is a fairly large chunk of code it is hard to skim through it and find what you looking for, so why not ask the original devloper of the class in his forum?

  3. if you know how to make a connection to the database and querying it and the style of the rss feed, then make a query to the table that you want to generate the rss feeds for, then echo within the query the tags of the rss with the values of the table.

  4. Sure it is possible. Firstly I suggest you change the way you are uploading files since you want to upload multiple files at the same time. check out the code at this page: http://www.phpeasystep.com/phptu/2.html

     

    it is a very good tutorial on how to create multiple files upload in php. Once you are done you can use a function (instead of including a file to move the uploaded files to wherever you want).

     

    hope this helps

  5. ok. here is the code. I modified according to payscale website. You had many small mistakes in your script, but anyway it is working now on my computer. So if it does not work with you check the rest of your script.

    <?php 
    $job = 'Registered Nurse (RN)';
    $state = 'Seattle';
    $city = 'Washington';
    $contry = 'United States';
    
    
    echo "<a href=\"http://www.payscale.com\" 
       title=\"Research Salary at PayScale\"
       onclick=\"javascript:PayScaleExtension.displaySalaryCalculator('$job', '$state', '$city', '$contry');return false;\">
       <img src=\"http://www.payscale.com/images/research_salary_bug.gif\" alt=\"PayScale\" width=\"109\" height=\"23\" border=\"0\" /></a>";
    
    ?>
    

  6. alright, here is another approach. first try to remove $info completely from js (just to know the js is working fine and the proble is with the php variables). if everything is ok then try to include the data of $info straight into the js without using implode:

     

    <?php 
    echo "<a href=\"http://www.payscale.com\" 
       title=\"Research Salary at PayScale\"
       onclick=\"javascript:PayScaleExtension.displaySalaryCalculator('$title','',",'$city',",",'$state' , 'United States');return false;\">
       <img src=\"http://www.payscale.com/images/research_salary_bug.gif\" alt=\"PayScale\" width=\"109\" height=\"23\" border=\"0\" /></a>"
    
    ?>
    

  7. Hey, thanks for reply. But still nothing, it displays it right next to the image link. Here's full code that I'm using:

    <?php 
    $info = array("'$title'",",","'$city'",",","'$state'");
    $info = implode(', ', $info);
    
    echo "<a href=\"http://www.payscale.com\" 
       title=\"Research Salary at PayScale\"
       onclick=\"javascript:PayScaleExtension.displaySalaryCalculator($info , 'United States');return false;\">
       <img src=\"http://www.payscale.com/images/research_salary_bug.gif\" alt=\"PayScale\" width=\"109\" height=\"23\" border=\"0\" /></a>"
    
    ?>

     

    This is how it displays it:

    Sales Representative', ,, 'Greece', ,, 'New York' , 'United States');return false;">  

    Plus image link next to it.

     

    Thanks for your help.

     

    isn't  that what you wanted? displaying texts within the js?

     

    Do you mean that javascript is broken at some point?

  8. hi

    try this

    <?php 
    $info = array("'$title'",",","'$city'",",","'$state'");
    $info = implode(', ', $info);
    
    echo "<a href='#' onclick=\"javascript:PayScaleExtension.displaySalaryCalculator($info , 'United States'); return false;\">Click here</a>
    

  9. I forgot to mention, you have to place both code withing your php tags so the name is read as an array:

    <?php
    foreach ($_POST[names] as $key => $value)
    {
    // your code here
    }
    
    echo "<input type=\"checkbox\" name=\"names[]\" value=\"$value\">";
    ?>
    

  10. make the checkbox name an array like this:

    <input type="checkbox" name="names[]" value="$value">
    

     

    then when you get the posted data you can use a foreach loop

    foreach ($_POST[names] as $key => $value)
    {
    // your code here
    }
    

  11. what do you mean by

    However, only in one of the files does $boxselected worked. HOWEVER other lines of config.php  ARE working in BOTH pages.
    Do you send the values of config.php to $_GET array?

    It is always a good practice to print this line:

    echo nl2br(print_r($_GET,1));

    Where you can see the whole array $_GET and check its keys and values.

     

    Is there any other way to do it without redefining the same thing twice?

    just add the beginning of the function "global $boxselected;" or make "$boxselected" one of the parameters passed to the function.

×
×
  • 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.