mmcdonald 28 Posting Pro

I can't recall exactly where it is, but apache blocks http and https access to the folder named cgi-bin, if you rename it you'll have access instantly.

In your hosts file, apache config or somewhere similar, perhaps your cgi library folder! (I can't quite remember...) actually... Just run a scan for any part of this to find it:

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">

And then change the settings:

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

Then restart the apache service. You should be able to browse into that folder. I had to do this for a project once and found that setting up a simple symbolic link solved the issue.

Also, as a side note, this question was best aimed at the LAMP category ;) Either way I hope it sheds some light onto your situation!

Michael

Ancient Dragon commented: Thanks +14
mmcdonald 28 Posting Pro

Here's a mock-up function:

  $config = array("host"=>"localhost",
                  "user"=>"root",
                  "pass"=>"pass",
                  "db"=>"database");

    function userInfo(){

        //Global config to call on the database connection values.
        global $config;

        //Global $userInfo so we can use it outside of the function.
        global $userInfo; 

        //Connect to database
        $mysqli = new mysqli($config['host'], $config['user'], $config['pass'], $config['db']);

        //Construct query as a string
        $query = "SELECT * FROM users WHERE id = '50'";

        //Run the query
        $result = $mysqli->query($query);

        //Construct an array based on the results of our query
        $userInfo = $result->fetch_array(MYSQLI_ASSOC);

        //Free up resources by freeing the $result variable
        $result->free();

        //Keep it tidy and close the connection to MySQL
        $mysqli->close();
    }

(Remember to add error checking and such!)

Then just call userInfo(); at the top of your file, or in your config file, and then you can print any table values using column names for the user with the id of 50 using: $userInfo['firstname'] or $userInfo['email'] and so forth.

To get data for the current user simply change '50' in the string above to the session value for that user and so forth... that should be self explanatory :)

Also you should notice that I'm constructing an associative array using fetch_array(MYSQLI_ASSOC) which means that variable names stored in the array are identical to the column the value has been collected from. You can also use fetch_array(MYSQLI_NUM) which would make your variable names relative to the column number the value was collected from and the variable would become $userInfo['0'] or $userInfo['9']. You also have the option of fetch_array(MYSQLI_BOTH) which …

mmcdonald 28 Posting Pro

You'll have to forgive me as I might have missed the topic, I'm not to sure, but why not use any development environment and then have a web browser to view the code? Seeing as HTML, JS and CSS are all web based languages?

I'm a lazy bugger so I develop locally, I have chrome on one monitor that uses an extension to refresh every 5 seconds and my development environment on my main monitor.

As a personal opinion it works fine for me, but I can understand why it's not everyones cup of tea.

I use PHPDesigner8 for web application development (ignore the name, it does way more than just PHP), and it does have a run/view screen & tool for previewing HTML from the environment.

daino commented: good idea with chrome +3
mmcdonald 28 Posting Pro

Hi all,

I'm having that oldschool issue with saving rich text content to MySQL and then retreiving it. As far as I'm concerned I thought I was doing it correctly - but one of you lucky devils is about to tell me otherwise :D

When I'm saving to DB:

    if(isset($_SESSION['auth'], $_POST["topicid"], $_POST["response"])){

          $configureEntities = htmlentities($_POST['response']);
          $formattedResponse = mysqli_real_escape_string($configureEntities);

          $mysqliDebug = true;
          $mysqli = mysqli_connect($config['host'], $config['user'], $config['pass'], $config['db']);

          $date_added=date('Y-m-d H:i:s');
          $query = "INSERT INTO topic_response(topicid,usersid,response,date_added) VALUES (?, ?, ?, ?)";                                                
          $stmt = $mysqli->prepare($query);
          $stmt->bind_param('ssss', $_POST['topicid'], $userInfo['id'], $formattedResponse, $date_added);
          $result = $stmt->execute();
    }

When I'm echoing response data:

`echo stripslashes($topicResponseInfo['response']);`

I also have the entity encoding feature to TinyMCE set to raw:

`entity_encoding : "raw"`

However... if I use the formatting features in TinyMCEsuch as bold, underline, font types, font sizes and so forth the submission is stored in MySQL as null. I did have it working at one point, but only for certain features, as I was able to submit <p>I love this!</p>\n<p>It\'s quite good you see. and it was successfully saved to SQL. There were however other things breaking it such as font size. Totally baffled.

//This:
<p>I love this!</p>\n<p>It\'s quite good you see.

//Came from submitting this:
I love this!
It's quite good you see.

The real question is, with rich text editors, how do you correctly encode, escape and recall?

Thanks in advance, repuation to the beautiful person who clearly explains the correct way of storing and then echoing RTE generated strings!

Michael

mmcdonald 28 Posting Pro

As I said..

Actually... why on earth do I do that? -.-"

:D

mmcdonald 28 Posting Pro

Sorry missed Atlis mention of it :) Touche my friend, touche.

M

mmcdonald 28 Posting Pro

I'm lost in translation - are you asking how to secure your code and directories?

mmcdonald 28 Posting Pro

Mac Mail changes it's options dependant on the users previous input. It can also check with the mail server based on the user previous input to see if the server can handle POP3 or IMAP. Looking at Fasthosts it looks like the advanced account may only be able to use IMAP (Based on their example in the article above). It could also be something to do with port configuration - but that's a longshot as the ports usually change based on the users input.

If you want my email to get in touch easier when you're at your daughters MacBook then send me a PM and I'll gladly share it with you. It wouldn't even phase me to connect remotely using TeamViewer to help you solve the issue, should you be willing to trust me of course!

Michael

mmcdonald 28 Posting Pro

A third party one or the windows one? How did you manage to uninstall it?

I'm goin to gather the Windows one, and in which case I think it's disabled if anything not uninstalled. To get it back you should do this!

Good luck,
Michael

mmcdonald 28 Posting Pro

@Diafol...

Am I going mad? :) Didn't I say str_*? Or are you just clarifying the solution? haha

Michael

mmcdonald 28 Posting Pro

Hi to you too ggeoff, where are my manners!

Was the guide I posted no good to you? Please take no offence as none is meant - but your daughter must be entering something incorrectly to be prompted for exchange server details, unless fasthost use an exchange server for their advanced email accounts? Actually I've just reviewed their sales website and they do have exchange based email accounts on offer.

I have just found this article on the FastHosts support portal.

This FastHosts guide runs through the setup of an advanced email account on mac Mail 6, I hope it helps!

Michael

mmcdonald 28 Posting Pro

DavidB is spot on :) There are forums full of middle aged munchkins dedicted to legacy technologies and languages - so if you're looking for more activity then that should be your next stop, good luck and have fun!

mmcdonald 28 Posting Pro

POP3 email from what service provider? Hotmail? Google? yahoo? Or is this a corporate/private mail server? If you let me know I could list most of the important field values for you. Here's a good guide: http://hostpapasupport.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=378

Would help to know the iOS version as they configure differently.

mmcdonald 28 Posting Pro

Not me - I don't even think people view profiles. I certainly don't xD

mmcdonald 28 Posting Pro

What's wrong with the 'Home Page' field that's available on your profile and your signiature? The Home Page field is perfect for the addition of your blog.

Also, the beauty of friend and connection requests is that they can be declined :D

mmcdonald 28 Posting Pro

PAYMILL look fine, a smaller provider which of course carries scalability risks but they look very well managed. Their API also looks very simple, well constructed and probably wouldn't take that long for a beginner to grasp what's going on. I'm still concerned about your level of programming experience and understanding - you're a risk to yourself and your customers.

mmcdonald 28 Posting Pro

PAYMILL look fine, a smaller provider which of course carries scalability risks but they look very well managed. Their API also looks very simple, well constructed and probably wouldn't take that long for a beginner to grasp what's going on. I'm still concerned about your level of programming experience and understanding - you're a risk to yourself and your customers.

mmcdonald 28 Posting Pro

Highly confusing as JorgeM has politely pointed out. Are you trying to collect the username from the record that has the user_id of 3? What do you mean recipient? Are you constructing a script in a programming language at the same time too? Get back to us when you have enough time to... type?

mmcdonald 28 Posting Pro

You also have another _POST to collect, I don't think it's required, not by a long way, but I usually chck it anyway. Your submit button has the following name: name="Submit" so you can add it to your form processors prereqs:

    if(isset($_POST["myusername"]) && isset($_POST['mypassword']) && isset($_POST['Submit'])){  
      $username =$_POST["myusername"];
      $password =$_POST['mypassword'];
    }   

Actually... why on earth do I do that? -.-"

mmcdonald 28 Posting Pro

http://php.net/manual/en/function.str-replace.php, use the str_replace() function to find certain phrases within a string and instantly replace them with alternative phrases.

mmcdonald 28 Posting Pro

+1 to Diafol, awesome point :)

mmcdonald 28 Posting Pro

I have an Amazon payments account and I live in the UK..? Either way you have your choices. I would recommend 2Checkout if anything. Theres's not much more anyone here can do for you.

Cheers,
Michael

mmcdonald 28 Posting Pro

Lilwizz, you can calculate frequency in a loop. Set $count = 0 and at the end of each loop increment count by one : $count++. In the middle of the loop you'll need to execute a query counting the number of rows where age = $count. You can of course limit the loop to 100 as I doubt you'll ever have anyone over that age? Store the result of each loop in an array and then you'll be able to count frequency. Make sense?

For range you just need to retrieve the lowest and highest value in the age column.

I don't know what you mean by variation..?

The only reason I'm not giving you the code straight up is that you've shown no evidence of trying to figure it out for yourself. Post some code as your attempt and we can help you make improvements and get it working.

mmcdonald 28 Posting Pro

PHP runs server-side, before rendering the output to the browser. Javascript runs client-side, in the browser. You cannot just add PHP code to a Javascript event like that.

Exactly my point, you either use JS Daniel or sit there for a few decades until PHP8 comes out, maybe that'll allow for similar functionality :D

mmcdonald 28 Posting Pro

You have Google Checkout and PayPal to use... they're free. Are you under 18? In you're actually over 18 and you can't figure out why your PayPal is blocked you're either doing something illegal or not trading ethically?

mmcdonald 28 Posting Pro

I'm not interested in building/owning one - just thought it would be a good feature for DW :D

mmcdonald 28 Posting Pro

You're still going to need to use JS though to show/hide the div without refreshing the page.

Only other choice is to refresh the page and use an if statement to hide or show the div.

mmcdonald 28 Posting Pro

I don't understand what you're asking for from the community here?

If you don't have a PayPal merchant account or premier then yes you will need to either upgrade your PayPal account to remove the limit or use another payment gateway. There are millions on the world wide web... google it. You'll need to register an account with a valid visa debit/credit card and then autheticate you're who you say you are. You can then use that gateways API to develop your own transaction system.

To be honest by the sounds of it you shouldn't be selling anything online, now please don't take offence to this, but I have seen your level of programming and the chances are that you're putting all of your customers sensetive data at risk. I'm pretty sure you probably don't have a valid SSL certificate and that you're not hashing & salting. I would also bet my bottom dollar that you're not working within any compliance standards for ecommerce either.

You should be sticking to something like OpenCart at your level. Check out my in-depth response to another user regarding ecommerce here.

mmcdonald 28 Posting Pro

I would never use PHP for this, have you considered using JS or is the use of PHP a must? Infact I don't think you'll ever achieve this with PHP alone.

Check out this example, it's pretty self explanatory and will show you how to hide/show a div using JS.

Good luck!
Michael

mmcdonald 28 Posting Pro

Great point rubberman - VPNs are a great tool to remain anonymous as they allow you to securely route your traffic through other nodes connected to the public network. If someone wanted to lookup your location they would get a different IP, Country and Town every time. See here to understand how distributed nodes can be used to hide your true location/identity.

mmcdonald 28 Posting Pro

It is just fun to stand out :D

Have I missed something...? O.o haha

mmcdonald 28 Posting Pro

Angry? I'm not angry haha, just in and out of meetings, I'll look back when i can, sorry!

mmcdonald 28 Posting Pro

You didn't take on board my advice of having your PHP form processors above any html output, you have a header function below PHP - it will result in a fatal error.

mmcdonald 28 Posting Pro

here is my whole page ... can't undestund why it work on local server and not on hosting server...

That's fairly easy to answer, different versions of PHP or different PHP configuration settings. Apache settings could also have an effect. Let me look at your code and get back to you.

mmcdonald 28 Posting Pro

+1 to JorgM... in fact this is the first time I've ever heard of someone consider bluetooth for such as activity.

You say you have wireless, which means you have a wireless router or AP... so I gather you already have a private network? Do you mean you wish to setup file sharing and resource sharing (printers etc)? If so... it's very straight forward.

If you have a few ethernet ports available on your router then you could technically connect the majority of your devices (printers, network attached storage, scanners and so forth) and then access these devices using computers and other devices that are connected to that router wirelessly.

I have a QNAP server and a laser printer connected to my home router. All of the computers in my home are wired and my laptops are wireless. This allows all of my devices to confidently access both the NAS and my printer from any location within the house. I've also mapped some network drives to the devices, the security of which is all configured and managed within the QNAP administration panel that is accessibly via any device on my private network.

mmcdonald 28 Posting Pro

Sounds like an accurate statement that would hold true for any publicly traded company.

You're right, but Google take it to a new extreme and end up screwing over their users in the process; after all - that excess revenue has to come from somewhere.

mmcdonald 28 Posting Pro

Then it's another part of your code causing the issue... right? Can you add your while script please, easier to work with too. It would also ne nice to know the name of the current file and the value of $_SERVER['Query_String'];

mmcdonald 28 Posting Pro

When this function is called: header('Location: http://url.com/'.$insertGoTo); users are redirected to the script defined after 'Location:'.

Make sure you have all your PHP processing ABOVE any HTML.

mmcdonald 28 Posting Pro

If you're just trying to redirect why aren't you using the header(); function and placing the form processor code (Your isset code) above any HTML on the page to avoid headers already sent errors?

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "valide")) {
  $insertSQL = sprintf("INSERT INTO commande (client, `date`, subtotal, total) VALUES (%s, %s, %s, %s)",
                       GetSQLValueString($_POST['client'], "text"),
                       GetSQLValueString($_POST['date'], "date"),
                       GetSQLValueString($_POST['subtotal2'], "double"),
                       GetSQLValueString($_POST['total'], "int"));
  mysql_select_db($database_marketbase, $marketbase);
  $Result1 = mysql_query($insertSQL, $marketbase) or die(mysql_error());

  $insertGoTo = "myspace/order-line.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }

  //This will take user to your defined location
  header('Location: http://url.com/'.$insertGoTo);
mmcdonald 28 Posting Pro

That's understandable and no we share a very different mind set :D Windows 8 is shite yes but if you dig right it, I mean really get into the cracks and crannies, Windows 8 is still better than Vista! :D

I will however always be a fan of Windows 7 (and a proud user of the now dead XP :D)

I didn't think it would be a virus at all - adware did however cross my mind. Either way check your current installed add-ons/extensions to make sure nothing has creeped onto the list, if there is something there that you didn't install - remove it. If there is nothing there use an AV or run malwarebytes; it's better to be safe than sorry!

I would recommend you choose either Firefix or Chrome for your browser anyway, if you use IE then you deserve to be shot just as much as the developers themselves.

Good day to you,
Michael

mmcdonald 28 Posting Pro

No idea why you put this in Tablets and Mobile devices? It's probably why you haven't got a response.

Is this on your phone? Or a tablet? Or a computer...?

What page? You mean a browser tab? What browser?

mmcdonald 28 Posting Pro

@silverrice I don't think that's the case at all... I've never done such a thing and even with the forward slash you're still reading from the same directory?

I usualy use:

<link rel="shortcut icon" href="/favicon.png" type="image/png">
<link rel="shortcut icon" type="image/png" href="http://www.example.com/favicon.png" />

or:

<link rel='shortcut icon' type='image/x-icon' href='/favicon.ico' />
mmcdonald 28 Posting Pro

JorgeM is spot on, but I'd like to add a few key characteristics and uses of a VPN. Virtual Private Networks exist when a private network (such as a corporate or home network) extends to another geographic location through the use of the public telecommunications infrastructure (I.E. The Internet).

One of the biggest uses for a VPN in the current digital age is for corporation to allow their staff to remotely connect to their private network from home, cafes or just about anywhere with an internet connection!

Two LANs will use a WAN to connect to eachother, however to the two LANs will access their network resources differently and their resources, such as printers, scanners or network drives are not shared. The beauty of a VPN is that all users share their resources as though all persons connected are sitting on the same LAN.

Most VPNs are secure and utilise some of the latest protocols and technologies such as IPSec, SSL/TLS, SSTP, SSH, MPPE and more.

For accurate and trustworthy authentication network to network connections often rely on a password or digital certificate - this allows the VPN to establish automatically without any user intervention. The password or signing of the digital certification must be the same on both ends of the tunnel. Before a tunnel is established both ends of the tunnel must authenticate.

The most popular authentication method used by corporations for their users are SecureID tokens, followed by a standard password and then biographic/cryptographic authetication.

I hope …

mmcdonald 28 Posting Pro

This could be one of a few things. Faulty NIC, corrupt or non-existent drivers, dead router, dead ADSL connection... Check your event logs for errors and notices.

I would try to connect to the internet on another machine in the same house. If that connects then I know I can dedicate my focus to the PC at hand. If not, then I'd look at fixing the internal network.

Let's say we're looking at the originally mentioned PC. I'd start by trying another NIC if I had one. If not, then I would look into the drivers, or debate borrowing or buying a USB wireless receiver to connect to the web and download the latest drivers for my NIC. (Forget your NIC for now... don't you have an intergrated ethernet port to test with?)

Just some baseline troubleshooting steps there, there more you give me (such as event log data) the more I can help.

Michael

mmcdonald 28 Posting Pro
mmcdonald 28 Posting Pro

I thought my code was fine, I thought I'd implement it on another page and it works great, must be a conflict so I'll look into it. Thanks

mmcdonald 28 Posting Pro

Don't worry, I flagged it hours ago for a category change xD OP: you need to look into positions on the image and the wrap of the image too.

mmcdonald 28 Posting Pro

I'm not using the example, this is a reponsive modal included in a premium package. I read your suggestion and though I could see where you were coming from, I know it wouldn't work. In fact I was correct in imagining where the modla would end up. It was off the the top left of the screen with 75% of the modal off screen.

See current state: http://imgur.com/nz2AkMO

The reason I know this wouldn't work is partially because you removed: margin-left: -380px;. The modal has a width of 760px therefore minus 50% of it's width is required to place the modal into the center of the screen.

The other reason is that the modal first appears in the correct location when initiated and then suddenly jump to the top (happens in a microsend, literally), so it could still be JS.

The problem is hidden well and racking my brains.

Thanks
M

mmcdonald 28 Posting Pro

That's my question answered then - cheers Dani!

mmcdonald 28 Posting Pro

Yeah now I look at it it's similar to what I'm talking about. Forget dzone as it looks hideous and think about hot scripts (which doesn't look THAT much better haha). I'm simply talking about a community managed directory of useful development tools and such. If it's that overlooked then forget I made this suggestion; you have enough to do as it is :)