Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example 5 #2

Open
kklepper opened this issue Dec 11, 2013 · 5 comments
Open

Example 5 #2

kklepper opened this issue Dec 11, 2013 · 5 comments

Comments

@kklepper
Copy link

Thanks a lot, this is extremely helpful.

But some problems in Example 5: dynamic does not work.

How to see:

add

ini_set("display_errors", 1);

to public/index.php. You'll see why you didn't see anything: you have problems with mysql.

How to fix:

change @'%' to @'localhost' in dynamic.sql

DocumentRoot

DocumentRoot is not executed as given in dynamic-site.conf, so http://192.168.0.42/dynamic-site/ or http://myprecisebox/dynamic-site/ will show the directory structure of dynamic-site instead of dynamic-site/public/index.php

As a result, references to href in the html files fail. No idea how to fix this yet.

@michaltakac
Copy link

Few dirty moves, just to get it working in http://your.ip/dynamic-site/public...

Open /dynamic-site/application/views/additem.php

Change:

<form method="post" action="/add.php">

To:

<form method="post" action="/dynamic-site/public/add.php">

Same changes in other files
edititem.php
Change:

<form method="post" action="/edit.php?id=<?= $item->getId() ?>">

To:

<form method="post" action="/dynamic-site/public/edit.php?id=<?= $item->getId() ?>">

allitems.php
Change:

...
        <td><a href="/edit.php?id=<?= $item->getId() ?>">edit</a></td>
...
<p><a href="**/**add.php">add new item</a></p>

To:

...
        <td><a href="/dynamic-site/public/edit.php?id=<?= $item->getId() ?>">edit</a></td>
...
<p><a href="/dynamic-site/public/add.php">add new item</a></p>

header.php
Change:

<link rel="stylesheet" href="/assets/reset.css"/>
<link rel="stylesheet" href="/assets/dynamic.css"/>

To:

<link rel="stylesheet" href="/dynamic-site/public/assets/reset.css"/>
<link rel="stylesheet" href="/dynamic-site/public/assets/dynamic.css"/>

In /dynamic-site/public in add.php and edit.php, change all these lines:

header('location: /');

To:

header('location: /dynamic-site/public/');

@michaltakac
Copy link

Shouldn't be done like that

@richardforth
Copy link

^^^ Scam post ignore (dodgy link)

@indradhanush
Copy link

I reported the user with a link to this comment. Would suggest others do the same.

@richardforth
Copy link

Great, I can see its been removed, top job!

Repository owner deleted a comment from sweeper02 Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants