Jump to content

dani33l_87

Members
  • Posts

    38
  • Joined

  • Last visited

Posts posted by dani33l_87

  1. I have build a small form that take the zip code that user enter and if is on my list will redirect to a sub domain craigslist.

     

    I was checking all the zip codes and is pretty hard to know to what bigger city to attribute the  given zip code and for that I was thinking to a simple idea to use, I am not sure how much exact will be but I think will do the trick for the moment.

     

    The zip code range start from  00501 to 99950. 

     

    I create a array with the biggest city shown in craigslist and the zip code that correspond. 

     

    Now the tricky part, what I will do with the rest of the zip codes and my idea is to measure the distance from one to another zip code and which zip code from the array is closer from given one  to take it.

    <?php 
    
    $zip = $_GET['zip']; 
    
    
        $z = array (
    36830 => array ( 'auburn.craigslist.org' ),
    35242 => array ( 'bham.craigslist.org' ),
    36301 => array ( 'dothan.craigslist.org' ),
    35630 => array ( 'shoals.craigslist.org' ),
    35901 => array ( 'gadsden.craigslist.org' )
    
    
    ?>
    
    
    
    
    Exemple:
    
    $zip= 36870 // the code received from the user
    
    36870 - $array=  ( 'auburn.craigslist.org' ),
               (36830  = 40)
               (36301 = 569)
               (36911 = -41)  // the minus will be excluded
               (....etc)
    

    After checking the zip code with  the ones from array, the smaller score will attribute the sub-domain  correspond from the array. I hope will don  t be the case when will get  the same result from two zip codes:)

     

     

    Now I am using this rule:

    $zip0 = (isset($z[$zip][0]) && $z[$zip][0] != '') ? $z[$zip][0] : 'craigslist.org/about/sites#US';

    and I was thinking to redirect the user for a page to enter the state and the city. But I wish to make it more precises and not to involved the user so much.

     

     

    But if there are any other suggestions I will be glad to hear them.

  2. I have this form:

     

     
    Start Year:
    <select name="start"><option value="" selected="selected"></option>
    <option value="1991">1991</option><option value="1992">1992</option><option value="1993">1993</option><option value="1994">1994</option></selected.
     
    to:
    <select name="end"><option value="" selected="selected"></option>
    <option value="2015">2015</option><option value="2014">2014</option><option value="2013">2013</option><option value="2012">2012</option>
    <option value="2001">2001</option><option value="2010">2010</option></select>
     
     
    $start = $_GET['start'];     // value="1994"
    $end = $_GET['end'];      // value="2001"            
     
    //the value can change
     
     
    How can I get all the years between 1994-2010 + some text
     
    $years= T1994YearT1995YearT1996YearT1997YearT1998YearT1999YearT2000YearT2001Year
     
     
     
     
  3. The structure for the array look nice, but what about the connection between the form and the array.

     

    Because now is not taking into the consideration the value that come through input:  $miles=$_GET['miles'];   

     

        $miles = array (
                    25 => array ('close', 'closest', 'hot'),
                    50 => array ('aaa', 'bbb', 'ccc'),
                   100 => array ('xxx', 'yyy', 'zzz') 
                );
     
    In this case we have all the three values but only one need to be shown.  For example:
     
    echo $miles[2]   will show ccc    // when 50 is the form outcome 
     
    if the outcome is 100 then 
     
    echo $miles[2] will show zzz
     
    if will be 25
     
    echo $miles[2] will show hot.
     

    I would like to keep &miles[array number] because I don`t know the output and will make easier to be used in a code.

     

    This is pretty much the result wanted.

  4. I have this form:

     

     

    <form method="get">
     
    Distance: <select name="miles">
    <option value="25" selected="selected">25 Miles</option>
    <option value="50">50 Miles</option>
    <option value="100">100 Miles</option>
    </select>
     
    <p><input type="submit" value="Submit">
     
    </form>
     
     
     
    and the php script file:
     
    <?php 
     
    $miles=$_GET['miles'];      // this is how I get the value of the input miles and try to convert the value (25) into a array
     
    $25=array("close", "closest", "hot")  // the value 25 will have three shown variants
     
     
     
    echo "This is, $25[2]";   // result  This is hot.   - this is the result that I want
    echo "This is, $25[1]";   // closest 
    echo "This is, $25[0]";  // close
     
    ?>

     

    I have problems to split a value into array, because for each value (25, 50, 100...) will be shown different echo words like in the example. I look on the internet but I can t really find something to help me with this. 

     

    It is a solution in PHP that will don t need to change the html form?

     

  5. Yes maxxd the last part is what I want:

     

    $link = "http://ebay.com/{$_GET['type']}/{$_GET['year']}/{$_GET['color']}/";

     

    But the first part is the problem. Because in the form should be only 2 option, that will have more values in the php script.

     

    The solution will be this:

     

    <?php
    $linkArray
    = array(
        'new' => array(
            newcars/',
            new/',
            newmake/'
        ),
        'old' => array(
            'oldcars/',
            /old/',
            'oldmake/'
        )
    );
     
    ?>

     

    But how can I take each array and put it in the link, because in "new" they are 3 array, how can I take a specific one and add to the link

     

    $link = "http://ebay.com/{$_GET['new']}/{$_GET['year']}/{$_GET['color']}/"

  6. Is not the answer what I am looking for.

     

    Jacques1, the text field is only for example, I will use radio buttons.

     

     

    To be more explicit, when you buy a car you have more filters:

     

    NEW    &  USED   (for this we create radio buttons for the user to chose)

     

     

    There are many website (3 for example) that have a primary link:

     

    http//ebay.com

    http//cars.com

    http//auto.com

     

     

    For New cars the value information needed to each website it s different, for example

     

    http//ebay.com/newcars/

    http//cars.com/new/

    http//auto.com/newmake/

     

    The user Select NEW (radio Buttons) and a php engine will add the above information for each link, having a predetermined information:

     

    NEW = new[0] = "newcars/"

    NEW = new[1] = "new/"

    NEW = new[2] = "newmake/"

     

    The result script for  will be:

     

    href="http://ebay.com/$_GET(new[0])        ==== >  http//ebay.com/newcars/

     

     

    This I will want to do for every link, if is possible.

     

    I hope now everything is more clear.

  7. I have the form:

     

    <form>

    What name people call you: <input type="text" name="firstname" value="xxx"><br>

    Your favorite cars are: <input type="text" name="brand" value"yyy">

    </form>

     

    Send to a php engine for processing.

     

     

     

    Insted of ($_GET["brand"]) to have only "yyy" value I want to have three values for the same input

     

    brand[0] = "yyy"

    brand[1] = "mini"

    brand[2] = "pontiac"

     

     

     

    TO work in three different links:

     

    http://($_GET["brand[0]"]).com                  html result:  http//yyy.com

     

    http://($_GET["brand[1]"]).com                  Html result   Http://mini.com

     

    http://($_GET["brand[2]"]).com                  Html resut    http://pontiac.com

     

     

     

     

    I want to use this kind of system to implement multiple website filters in only one form and make available the link to each one aleardy withh the fillters settings, insted of going to each website and type the same filters again.

     

    This is the basic that I need make. How can I do this small script?

  8. I have a form:

     

    <input id="house" name="element_1" class="element radio" type="radio" value="Daniel" />

    <input id="car" name="element_2" class="element radio" type="radio" value="Joe" />

     

     

    How can I give to "element_1" multiple value instead of only one?

     

    Welcome <?php echo $_GET["element_1"]; ?><br>   ====  Welcome Daniel

     

     

    element_1 = element_12 = element_13

     

    WHERE

     

     

    element_1 = Daniel

    element_12 = car

    element_13 = key

     

     

    Welcome <?php echo $_GET["element_12"]; ?><br>   ====  Welcome car

     

     

    I need to create a structure for a 10 different values.  I heard that will be easy to use array or object, I don t really now how to structure it.

     

     

     

     

     

     

     

     

     

     

     

     

  9. <html>
    <body>

    <form action="url.php" method="post">
    Website: <input type="text" name="web" value="phpfreak.com"><br>
    Category: <input type="text" name="cat" value="coding" ><br>
    <input type="submit">
    </form>

    </body>
    </html>

     

     

    How can I take the value from a form and insert it in a URL that can be accessed by the user:

                              http://{web}/{cat}

     

    A little complicate, how can I take the value without click it on submit action and open in a new page with the URL Values.

  10. Hi,

     

    I have a crwal engine and every time when I try to take a picture from a specific website, it also take some bullshit from superfish, creating iframe and div class, that I can`t deleted using jquery after my page is load.

     

    I was looking in my code and I found out that the only thing that trigger that is the <img src="<?php h(getPicture($itemRow['site'], if I remove 'site', I don`t see any other superfish code but also don`t see the picture. What can I do to take only the .jpg picture , without any of the other crap?

     

     

    <?php for ($i = 0; $i < count($itemRow['pics']); $i++) { ?>
    <a target="_blank" href="<?php h(getPicture($itemRow['site'], $itemRow['pics'][$i])); ?>">
    <img src="<?php h(getPicture($itemRow['site'], $itemRow['pics'][$i])); ?>" class="pic<?php if ($i == 0) e(" active"); ?>" />
    </a>
    <?php } ?
  11. HI,

     

    I was trying do add a function to my script to stop each 10 seconds, using max_execution_time. Apparently is not working and most probably from the php.ini file, that I can t change because I want for the others script to run normally.

     

    How can I write a function inside a php file to stop everything after 10 seconds.

     

    Or how can I make a script to stop after 100 processed items and start again after 30 seconds. I need to stop this file somehow.

     

     

    $processedItems++;
    e("{$processedIItems} of {$buffer->totalItems} (".sprintf("%.2f", $processedItems/$buffer->totalItems*100)."%)\r");
  12. Hi,

     

    I have this code:

    <div id="pics">
    	<?php if (count($itemRow['pics']) == 0) { ?>
    		<img src="<?php h("{$www_base}/none.jpg"); ?>" class="pic active" />
    	<?php } else { ?>
    		
    		<?php for ($i = 0; $i < count($itemRow['pics']); $i++) { ?>
    			<img src="<?php h(getThumbnail($itemRow['site'], $itemRow['pics'][$i])); ?>" class="thumbnail<?php if ($i == 0) e(" active"); ?>" picnum="<?php h($i); ?>" />
    		<?php } ?>
    		<div style="clear:both;"></div>
    		
    		<br />
    		
    		<?php for ($i = 0; $i < count($itemRow['pics']); $i++) { ?>
    			<a target="_blank" href="<?php h(getPicture($itemRow['site'], $itemRow['pics'][$i])); ?>">
    				<img src="<?php h(getPicture($itemRow['site'], $itemRow['pics'][$i])); ?>" class="pic<?php if ($i == 0) e(" active"); ?>" />
    			</a>
    		<?php } ?>
    		
    	<?php } ?>
    </div>
    

    This code practically take a picture and post it on my website, but the problem is that is also take the superfish advertisement, that I can see only in the html source.

    <div id="similarproducts_inimg" class="__similarproducts similarproducts_inimg generic generic" style="left:15px; top:465px;"><div class="container"><div class="explore_button _open_full_ui" style="height:100px; background-image: url('http://www.superfish.com/ws/images/inimg2/explore_en.png');" data-report-action="explore click"><div class="label"></div></div><a class="item free_shipping _merchant_click" target="_blank" href="http://www.........................</div></div> 
    

    How I can block a specific DIV to be created. I try some java-script and no success until now. Some other solutions?

  13. "

    All texts on the mails we send out are hardcoded, we need to incorporate those in our transtaltion system, this is done my incorpoating the texts in the function named "__" (double underscore)

    So this text:

    My Text

    Becomes:

    $this->__('My Text');

    It needs to be done to all hardcoded texts in "beta/emails" "

     

     

    What I suppouse to do because I look into all the files and I don t find any function "__" or "My text" in the code files in order to replace it. My question is this I sppouse to do or I don t understand what he want and I need to do something else?

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