Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.




438 posts

Ultimate Geek


Topic # 139391 7-Feb-2014 13:06
Send private message

Hi there Geekzone and thank you for reading this post.

Im currently trying to build a site for my research (references) to be accessed by other academics with interest in similar topic.

Background:

1 Created a master.dwt dynamic and responsive template.

2 Created also the pages that will load the content with extension PHP due to using a php code to populate my page with content (references).

3 Expression Web 4, when i preview the PHP pages all work and contents loads nicely.

4 the problem:  However when i try to add hyperlinks to the index.html page and click the right PHP page loads but does not execute the populating the page with the contents.



Would you awesome Geekzone experience developers would mind giving me tips on how i can fix this issue.


Note: the reason im using PHP pages is due to HTML pages would not save as HTML if there was PHP code in the page.



I thank you in advanced for sharing your knowledge,



Andrew

Create new topic
563 posts

Ultimate Geek
+1 received by user: 89


  Reply # 981810 7-Feb-2014 13:35
One person supports this post
Send private message

I'm a little unclear on exactly what you're trying to do (and haven't used expression engine) however I'll try help out.

*Generally* (URL re-writing, special web-server config etc aside ) PHP will only execute from within a .php file so you will need to display your html code within a php file not the other way around.

If your app is mainly PHP with some HTML you can setup your index.php (or whatever name.php) file like this and embed HTML;

<?php
   // Garbage Functions
   functionDo(stuff);
   otherStuff():

   // Insert HTML hyperlink
   echo '<a href="Google.com">Google Link</a>';
?>


If your app is mainly HTML with some PHP you can use PHP short code like this;

<html>
<body>
<table>
  <tr><td><?=$phpvariable1?></td><td><?=$phpvariable2?></td></tr>
</table>
<?=$phpfunction()?>
</body>
</html>





2113 posts

Uber Geek
+1 received by user: 188


  Reply # 981819 7-Feb-2014 13:43
Send private message

And is the PHP handler enabled on the host...

For instance Apache needs a few lines uncommented to advise how to handle php content

 
 
 
 




438 posts

Ultimate Geek


  Reply # 981871 7-Feb-2014 14:48
Send private message

wow thanks for your help i have managed to solve the issue thanks to you, i highly appretiated you taken the time to reply,


Thank you,




Andrew




Note: my website will go live sometime this weekend im just trying to figure out a way to setup a page that will secure page by user id and password login type.

and my webhost does use Apache at the server but i dont know the details of how i will set it up to work properly but for now its working perfectly in expression web 4 and all browsers i could find. cheers

563 posts

Ultimate Geek
+1 received by user: 89


  Reply # 981886 7-Feb-2014 15:10
Send private message

If your web host gives you access to a control panel like cPanel you can go to the "Password Protect Directories" setting and add password protection to the directory you want to secure, you will have to add all the usernames/passwords manually though.

This will give you a username/password prompt box when you attempt to visit the website and much simpler than implementing a PHP-based solution to get you going.

You can do the same thing by editing your .htaccess file directly but is a bit more complicated (https://www.google.co.nz/search?q=.htaccess+password)

If you do go down the road of wanting automated user signup etc and implementing that in PHP you'll need to do your research as it's not that easy to do it yourself securely if you're new to PHP (avoiding SQL injection etc).

You may want to look into learning a PHP framework (Symfony, CackePHP etc) or using a CMS (Drupal, Joomla, Wordpress) which will give you a lot of this stuff for free.





597 posts

Ultimate Geek
+1 received by user: 132


  Reply # 982007 7-Feb-2014 17:17
Send private message

For the username and password access, it's best to use a database. It is most likely your host will have MySQL installed so just create a new database with a table in it that has 3 fields, user_id, username, and password (we'll talk about security later on when you have a firm grasp of how everything works). Now accessing the database can be tricky for new beginners and because I'm lazy I'm just gonna tell you to download and include into your project a PHP library called idiorm which allows you to query the database as if it was a PHP object.

Set all that up and see how it goes, if you need help google it, all the answers for what you need are on the internet and there is no need to ask questions as you'll probably wait longer for a reply than the time it will take you to Google for an answer.




Regards
Stefan Andres Charsley



438 posts

Ultimate Geek


  Reply # 982104 7-Feb-2014 21:10
Send private message

kenkeniff, thanks for reply and yep i download it Symfony_Standard_Vendors_2.4.1.tgz, and will give a go at learning this.
thanks for your reply.


charsleysa, thanks for reply, I used visual studio and build a asp.net site http and it was tricky when website administration tool would not let me access the security tab despite having connection to the server.

Any way will go download a few bits and use google more often too.

thanks for all your help.



Andrew

Create new topic



Twitter »

Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

Air New Zealand experiments with blockchain technology
Posted 23-Nov-2017 15:39


Symantec selects Amazon Web Services to deliver cloud security
Posted 23-Nov-2017 10:40


New Zealand Ministry of Education chooses Unisys for cloud-based education resourcing management system
Posted 22-Nov-2017 22:00


Business analytics software powers profits for NZ wine producers
Posted 22-Nov-2017 21:52


Pyrios strikes up alliance with Microsoft integrator UC Logiq
Posted 22-Nov-2017 21:51


The New Zealand IT services ecosystem - it's all digital down here
Posted 22-Nov-2017 21:49


Volvo to supply tens of thousands of autonomous drive compatible cars to Uber
Posted 22-Nov-2017 21:46


From small to medium and beyond: Navigating the ERP battlefield
Posted 21-Nov-2017 21:12


Business owners: ERP software selection starts (and finishes) with you
Posted 21-Nov-2017 21:11


Why I'm not an early adopter
Posted 21-Nov-2017 10:39


Netatmo launches smart home products in New Zealand
Posted 20-Nov-2017 20:06


Huawei Mate 10: Punchy, long battery life, artificial intelligence
Posted 20-Nov-2017 16:30


Propel launch Disney Star Wars Laser Battle Drones
Posted 19-Nov-2017 21:26


UFB killer app: Speed
Posted 17-Nov-2017 17:01


The case for RSS — MacSparky
Posted 13-Nov-2017 14:35



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.