Jump to content

A Tutorial Series


Don't Ask

Recommended Posts

Well to start again. Sometime back with eStore I started a tutorial post in General Discussion forum, I was scolded by AngP (no hard feelings Ang) for overlooking the Tutorial Section already provided.

As told previously all the tutorials, that I posted back there, are not purely by me, they are/could be from other sources but I found them to be of use with eStore/Cube Cart, hence for the benefit of members here I am once again trying to start the tutorial section and invite other members too to post tutorial or link to good tutorial that could be beneficial to CubeCartizens.

Link to comment
Share on other sites

So here comes the first in the series.

SHTML & PHP -> Embedding PHP with SHTML

You can embedd PHP in SHTML pages using the following syntax/code

<!--#include virtual="pathto/somefile.php"-->

I am posting this small SHTML thing because I remember one of the member asked for similar solution in eStore forums and there the solution was not found at that time. So may be some one will benefit this time.

Link to comment
Share on other sites

  • 1 month later...

Many times we have been into problem because Cube Cart may not run properly because of register_globals or sessions etc and we don't have access to php.ini to change them as per our needs.

So we need alternate methods to set these settings as per our needs, so here is a nice tutorial for it.

http://www.phpfreaks.com/tutorials/10/0.php

And here is the whole list

http://www.php.net/manual/en/function.ini-set.php

Link to comment
Share on other sites

I too hope for AngP to get well soon and wish her best of health.

Now I realise why I was not feeling good at forums here, as it is now long time I did not received any scolding from her, as it was a regular feature for me in old eStore forums. And I am missing it.

Link to comment
Share on other sites

Looking at the recent contribution from brooky[/] about email thing at http://forums.cubecart.com/index.php?showt...st=0entry2711 , I was wondering if php canwork in background, I mean no time outs etc, so again I was searching for solutions and I came across this tutorial

http://www.phpfreaks.com/tutorials/71/0.php

I think this is a bit advance for dummies like me, but the Gurus can do it easily, or may be brooky will integrate some thing like this into next version of Cube Cart.

Link to comment
Share on other sites

  • 1 month later...

Now this register_globals and session problem is a pain for people around here and it is more for those who do not have control over there server, and there host will not alter these settings, for them.

So on Linux server if you are familiar there is a file called ".htaccess" this file can do wonders if you know how to use it.

For solving your above problem create a file ".htaccess"

put these lines in it

php_flag register_globals on

php_flag session.auto_start = 1

now put this file ".htaccess" within the root folder on your server, means if you are uploading your files to /public_html/ then upload this .htaccess to the same folder.

Before this check if .htaccess already exists, if yes then edit the existing file and put the above code in it.

Now register_globas and session are on for you only and this will not affect other users on that machine.

Link to comment
Share on other sites

Just as I was posting the reply to one of the problems, I thought that this could be of help to others too.

So if you want to see hidden files on your remote server through Ftp, say you want to view/edit .htaccess, normaly you cant see that it's there.

If you are using Cute Ftp, Press Ctr+L and Filter Panel will pop up, there Select "Enable Remote Filter (Server applied Filters)" and type -a in the Remote Filter textbox. Press OK.

Now you will be able to see hidden files.

Link to comment
Share on other sites

  • 6 months later...
Guest kencash

hi,

I have created a .htaccess file and uploaded to my server with the codes given here, as soon as I uploaded the file the following error appear

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

If you think this is a server error, please contact the webmaster.

Please advise.

kencash

Link to comment
Share on other sites

Hi kencash,

What exactly you are trying to achieve.

I mean what problem you were facing before you uploaded .htaccess.

And did you typed in the exact code taking care that this whole thing is case sensitive.

Further it will help if you can tell us more about your server environment in detail.

Link to comment
Share on other sites

  • 1 month later...

Another nice tutorial I found at

http://www.phpbuilder.com/tips/item.php?id=667

Its about table resizing with screen resolution change and goes like this.

Changing the Display dynamically

Submitted By: A.K.Deivanaathan

Date: 03/01/04 17:12

We might have come across many situations to change the table structure dynamically according to the screen resolution the user has. This can be achieved in many ways. I will discuss here some of the ways which I have worked out.

This material considers that the user will be using Tables in their pages. If not then it can be achieved using the Layers (DIV).

The first and easiest step is setting the width of the element to 100%. This is the easiest way to dynamically change the size of the user interface. For example

<Table width=100% border=0>

….

….

</Table>

and setting the width of the inner elements in Ratio (%) instead of setting it with Fixed values (Pts – Points or Pxs - Pixels). So what happens is it will fit the screen to the work area, so that even if the user changed his screen resolution the page will fit to that.

The problem is, if the user resizes the browser it will mess up the alignment of the table and display the information improperly, when the screen size is lesser.

So to avoid this, we can use the other approach. In this approach we will find the users’ Screen width and accordingly set the Width of the table. It will not collide though the browser is resized. The code sample is provided below,

….

…

<script language=javascript>

function ResizeTable(){

var objTable = document.getElementById(“tableidâ€) ;

objTable.style.width = screen.width + “pxâ€;

}

</script>

……

……

<body onLoad=†ResizeTable();“>

<table id=tableid>

…

…

…

</table>

</body>

</html>

This will fit the table width to the resolution the user sets and will avoid the misalignments that occur within the table even if the browser resizes. Hope this will be helpful to everyone.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...