Search Results

Search found 142 results on 6 pages for 'camran'.

Page 4/6 | < Previous Page | 1 2 3 4 5 6  | Next Page >

  • Cookie Value not available, why?

    - by Camran
    I have tested this on my development computer, but now I have uploaded everything to the production server and I cant read out the value of the cookie. I think the problem lies in the Serialization and Unserialization. if (isset($_COOKIE['watched_ads'])){ $expir = time()+1728000; //20 days $ad_arr = unserialize($_COOKIE['watched_ads']); // HERE IS THE PROBLEM $arr_elem = count($ad_arr); if (in_array($ad_id, $ad_arr) == FALSE){ if ($arr_elem>10){ array_shift($ad_arr); } $ad_arr[]=$ad_id; setcookie('watched_ads', serialize($ad_arr), $expir, '/'); } } When I echo this: count($ad_arr) I receive the expected nr, 1 in this case, so there is a value there. But when I echo the value: echo $ad_arr[0]; I get nothing. Completely blank. No text at all. Anybody have a clue? if you need more info about something let me know...

    Read the article

  • Application for making animated advertisement banners?

    - by Camran
    Don't want to learn anything like Adobe Premiere or something... I have images, or Frames as they are called... Now is there any simple yet elegant application which can put those frames into a timeline and make the animation? I am after an easy application so if you know of any, please let me know... Thanks

    Read the article

  • Passing along variable inside link works only on first word in multiple-word-variables, why?

    - by Camran
    I have this code below. As you can see I am passing two variables along with the link. The second variabye (category) works whenever it consists of one word, but some categories are two words or more, and then on the receiving php page where I fetch the variable only the first word is fetched. Any ideas? Example: I pass along this: Rims & Tires Only this comes through: Rims $display_table .= "<a href='../ad.php?ad_id=$row[ad_id]&category=$row[category]' target='_parent'>"; Here is how I fetch it in the receiving php file (which the link is to): $cat = $_GET['category']; echo $cat; //displays only first word of multiple word categories. Thanks

    Read the article

  • Solr automatic startup script

    - by Camran
    I have followed this tutorial: http://wiki.apache.org/solr/SolrJetty But I cant get it working. I don't know what to put in the etc/defaults/jetty file Does anybody know how to configure this? I have Ubuntu 9 Server. Thanks

    Read the article

  • Which MySql line is faster:

    - by Camran
    I have a classified_id variable which matches one document in a MySql table. I am currently fetching the information about that one record like this: SELECT * FROM table WHERE table.classified_id = $classified_id I wonder if there is a faster approach, for example like this: SELECT 1 FROM table WHERE table.classified_id = $classified_id Wont the last one only select 1 record, which is exactly what I need, so that it doesn't have to scan the entire table but instead stops searching for records after 1 is found? Or am I dreaming this? Thanks

    Read the article

  • Javascript "inlet" or "offset" function for drop-list options

    - by Camran
    I have seen on several sites that drop list values can have offsets... For example this drop-list: Fruits Apple Banana Orange Colors Red White Black The above are all options, but some have "inlets" or "offsets" or whatever you want to call it. How is this done with js? (regular js, not jquery at the moment) Thanks If you need more input let me know.

    Read the article

  • Does this query fetch unnecessary information? Should I change the query?

    - by Camran
    I have this classifieds website, and I have about 7 tables in MySql where all data is stored. I have one main table, called "classifieds". In the classifieds table, there is a column called classified_id. This is not the PK, or a key whatsoever. It is just a number which is used for me to JOIN table records together. Ex: classifieds table: fordon table: id => 33 id => 12 classified_id => 10 classified_id => 10 ad_id => 'bmw_m3_92923' This above is linked together by the classified_id column. Now to the Q, I use this method to fetch all records WHERE the column ad_id matches any of the values inside an array, called in this case $ad_arr: SELECT mt.*, fordon.*, boende.*, elektronik.*, business.*, hem_inredning.*, hobby.* FROM classified mt LEFT JOIN fordon ON fordon.classified_id = mt.classified_id LEFT JOIN boende ON boende.classified_id = mt.classified_id LEFT JOIN elektronik ON elektronik.classified_id = mt.classified_id LEFT JOIN business ON business.classified_id = mt.classified_id LEFT JOIN hem_inredning ON hem_inredning.classified_id = mt.classified_id LEFT JOIN hobby ON hobby.classified_id = mt.classified_id WHERE mt.ad_id IN ('$ad_arr')"; Is this good or would this actually fetch unnecessary information? Check out this Q I posted couple of days ago. In the comments HLGEM is commenting that it is wrong etc etc. What do you think? http://stackoverflow.com/questions/2782275/another-rookie-question-how-to-implement-count-here Thanks

    Read the article

  • js function causing all other functions not to work inside js file

    - by Camran
    In safari 4 and all explorer browsers, whenever I try to call a function inside a javascript file which contains this function below, that first function isn't called. So calling function1 will not work if function2 is inside the same .js file, explanation? Here is the code which makes the problem. Whenever I remove this function, everything works fine and all functions work fine. So this function is causing a problem. function addOption(selectbox, value, text, class, id_nr ) { var optn = document.createElement("OPTION"); optn.text = text; optn.value = value; optn.id = value; if (class==1){ optn.className = "nav_option_main"; } selectbox.options.add(optn); } Any ideas why? Thanks

    Read the article

  • another file_exists with special chars problem

    - by Camran
    I have some folders with special characters in their names. I run currently at a test-computer with Windows OS, but later I will use LINUX. My problem is that the folders with special chars in their names cannot be recognized somehow. ex: file_exists('../Bilar/27733691_1.jpg') // TRUE file_exists('../Båtar/27733691_1.jpg') // FALSE because of the special char in folder name... How should I solve this? I plan to run LINUX in the future when website is online... would that matter? Please explain thoroughly because I am a newb at this Thanks

    Read the article

  • Solr autocommit and autooptimize?

    - by Camran
    I will be uploading my website to a VPS soon. It is a classifieds website which uses Solr integrated with MySql. Solr is updated whenever a new classified is put or deleted. I need a way to make the commit() and optimize() be automated, for example once every 3 hours or so. How can I do this? (Details Please) When is it ideal to optimize? Thanks

    Read the article

  • Password verification; Is this way of doing it safe?

    - by Camran
    I have a classifieds website, where everybody may put ads of their products. For each classified, the user has to enter a password (so that they can delete the classified whenever they wish). So basically, when somebody wants to delete a classified, they click on the classified, click on the delete button, and enter the pass. I use MySql as a database. I use this code basically: if ($pass==$row['poster_password']) where row[poster_password] is fetched from MySql... What do you think? Thanks

    Read the article

  • Should I sanitize EVERY form variable passed along?

    - by Camran
    I have a form with many fields... The action is set to a php page which queries mysql... Should I sanitize with mysql_real_escape_string every single variable? Or can I ignore sanitizing drop-lists and radios for instance? Also, besides mysql_real_escape_string, what else should I do to prevent attacks? Thanks

    Read the article

  • Resizing iframe height using javascript issue

    - by Camran
    I have an iframe which content is a php-file, and that php-file displays some mysql records. The more records, the larger the iframe height should get, otherwise it wont show all of the information in the iframe. Here is a code I have for dynamically setting the iframe height, from the iframes content (the php file): var x = document.body.scrollHeight; x = x + 20 + 'px'; window.parent.document.getElementById("iframe001").style.height=x; iframe001 is the iframe I am referring to above. I am adding 20px of height extra because of borders etc... Now, sometimes this resizing works, sometimes it doesn't. Does anybody know why it works sometimes. If I alert the 'x' variable, it shows different values sometimes, but most times it works. Any other ways you know of setting the iframes height from the content of the iframe? Thanks

    Read the article

  • PhpMyAdmin; Should I disable root login?

    - by Camran
    I have this setup in Phpmyadmin: USER HOST PASSW PRIVILEGES GRANT debian-sys-maint localhost Yes ALL PRIVILEGES YES phpmyadmin localhost Yes USAGE NO root 127.0.0.1 Yes ALL PRIVILEGES YES root localhost Yes ALL PRIVILEGES YES root my_hostname Yes ALL PRIVILEGES YES username localhost Yes ALL PRIVILEGES YES Where "username" is my username and "my_hostname" is my hostname. I am currently only logging in as the last one (username, localhost). Also, I have php which also uses the last ones login details. Should I disable the other ones? And, what other security measures should I take? BTW: My server is Linux and I have root access. Thanks

    Read the article

  • Simple question about javascript history.go

    - by Camran
    I have a classifieds website. In every classified, there is a back link which simply takes the browser back one step. This is because when users search classifieds, and click on one to view it, they can easily go back with a link also (instead of only the browser back button). Here is the problem, if the classified is entered directly into the adress bar of a browser, or if somebody bookmarked a classified, then this back-link would take them someplace else... Is there any way of making sure that the previous page is a certain page (index.php in my case)? This way I would only display the back link if the previous page was index.php... Thanks

    Read the article

  • mysql PHP query question

    - by camran
    Ok, i have a problem here... I am sending values of drop down lists via ajax to this PHP file. Now I want to search a mysql database using these values, which I have managed to do, BUT, only if I set the values to something... Take a look: $query = "SELECT * FROM cars_db WHERE price BETWEEN '$cars_price_from' AND '$cars_price_to' AND year BETWEEN '$cars_year_from' AND '$cars_year_to' AND mileage BETWEEN '$cars_mileage_from' AND '$cars_mileage_to' AND gearbox = '$cars_gearbox' AND fuel = '$cars_fuel'"; now, what if the user doesnt select any "price_from" or "year_from"... The fields are only optional, so if the user doesnt enter any "price from" or "year from", then the user wants ALL cars to show... Do I have to write a query statement for each case or is there another way?

    Read the article

  • "slash before every quote" problem

    - by Camran
    I have a php page which contains a form. Sometimes this page is submitted to itself (like when pics are uploaded). I wouldn't want users to have to fill in every field again and again, so I use this as a value of a text-input inside the form: value="<?php echo htmlentities(@$_POST['annonsera_headline'],ENT_COMPAT,'UTF-8');?>"> This works, except it adds a "\" sign before every double-quote... For instance writing 19" wheels gives after page is submitted to itself: 19\" wheels And if I don't even use htmlentities then everything after the quotes dissappears. What is the problem here?

    Read the article

  • Possible to view PHP code of a website?

    - by Camran
    Is it possible to somehow view another websites php files/codes? Or to rephrase the question, Can my php codes be viewed by anybody except for those who have access to the file? If so, how cant I best prevent this? Thanks Ps: Server OS is Ubuntu 9.10 and PHP version is 5+ (Apache2)

    Read the article

  • Solr admin with only JRE possible?

    - by Camran
    I have installed JRE on my Ubuntu server. However, not JDK. When I execute solr to start, everything seems fine. But I cant access the solr/admin page. Wonder if this is possible without the JDK? Or do I have to have JDK installed? Thanks

    Read the article

  • Email server; Is this method spam-safe?

    - by Camran
    I have a classifieds website, and on each classified there is a tip-form where users may tip a friend about the classified. The tip-forms' action is set to a php-page, which mails the email after sanitizing etc... I have to filter away spam etc so that my email-server don't get blacklisted or anything... I have my own server (VPS, Linux) and have thought about a solution... How does this sound to you: 1- Install a mail-server 2- Configure Firewall to ONLY allow connections to the mail-server from my website 3- Configure the mail-server so that a maximum of 'x' emails may be sent every 5 minutes or so 4- Create a php filter before sending the mail, which checks for 'bad' words. 5- If necessary, as last resort, ask the user a question (ex 5+5) before submitting form I would rather preferr if I didn't have to implement the 5th implementation above... What do you think? Also, another q I have that you may answer is: If an email-server gets blacklisted, is there any way to un-blacklist it? Or whats the solution if this happens? Thanks

    Read the article

  • htaccess rewrite; Should I change all relative links or not?

    - by Camran
    I have a rewrite in htaccess which makes this: domain.com/ad.php?ad_id=bmw_m3_328942948 into this: domain.com/ads/bmw_m3_328942948 Problem is the links which are relative to the file wont work... for instance if a link is pointing at '/bin/edit.php' like this originally: domain.com/bin/edit.php // WORKS but after the rewrite the link wants to point here instead: domain.com/ads/bin/edit.php // NOT WORK - NOTE THE /ads/ DOESN'T EXIST IN REALITY Do you understand my issue? What is done about this? Do I have to make ALL links using the newer rewritten format? .htaccess: Options +FollowSymLinks Options +Indexes RewriteEngine On RewriteCond %{REQUEST_URI} !^/ad\.php RewriteRule ^annons/(.*)$ ad.php?ad_id=$1 [NC,L] Thanks

    Read the article

  • How to make this very long url appear short?

    - by Camran
    I have made most my site SE friendly, but one part of my site bugs me... I have a HUGE form in one of the pages, and when submitting the form (action=php_page) URL is so long it covers half a word document in one line with all the passing variables... This is very ugly... Is there any way to make this long URL appear short? Or some other solution you know of? Let me know if you need more input... Thanks

    Read the article

< Previous Page | 1 2 3 4 5 6  | Next Page >