Jump to content

Php Help


tywiggle

Recommended Posts

Hello,

I have a rather basic knowledge of PHP and SQL.  I am creating a large number of static web pages.  I currently have to change the variable 'pattern' by hand and then save the file manually as 'pattern'.  I can easily do a number of pages an hour but it is very tedious.  Is there a way to automatically add the variable and then save the page as 'pattern'.php?  Here is the code I have been using:

 

<?php

 

$cxn=mysqli_connect ("localhost", "xxxx", "yyyy");

mysquli_select_db($cxn, "zzzz");

$query="select pattern, a, b, c, d, e from 'database' where pattern='pattern'";(<--this is the variable I need to change automatically)

$result=mysqli_query($cxn, $query);

$row=mysqli_fetch_assoc($result);

extract($row);

?>

 

After 'pattern' is automatically inserted into the code I need to automatically save the page as 'pattern'.php and then move on the the next 'pattern' in the database.

 

Another question:  Is it possible to automatically convert existing php webpages to HTML pages and erase a date display from the code (the date shows but never changes).  I have also been doing this manually and it seems there has to be a better way.

 

 

Any suggestions or tutorials someone can point me to would be greatly appreciated.

 

Thank you,

Ty, the cross-eyed guy with worn out typing fingers.

Link to comment
https://forums.phpfreaks.com/topic/136826-php-help/
Share on other sites

Another question:  Is it possible to automatically convert existing php webpages to HTML pages and erase a date display from the code (the date shows but never changes).  I have also been doing this manually and it seems there has to be a better way.

 

why convert it to html? you can have the same benifits of using an html with a php, only php is better since you can do more. If it's about that date display, just delete the code related to it,

Link to comment
https://forums.phpfreaks.com/topic/136826-php-help/#findComment-714582
Share on other sites

To further clarify:  I have 3000 values to plug into the variable named 'pattern'.  After the value is plugged in, I need to automatically save the page as 'pattern.php'.  Any suggestions?

 

Not to stir the pot, but I really need to make the php pages into HTML.  This is for specific SEO purposes where a specific format of HTML is absolutely required.  Any suggestions?

Link to comment
https://forums.phpfreaks.com/topic/136826-php-help/#findComment-715761
Share on other sites

does the data ever change? I mean, once it is written to the page and saved.. will it change?

 

What your asking to do is basically simple... and the saving to html is no problem.

 

It sounds like your going to have 3000 pages called pattern.php, or are you wanting to use pattern.php to generate the html?

 

Where are the 3000 patterns stored? Are they in a text file, xml or where do you get them from right now?

 

Those are the first things to determine.

 

Nate

Link to comment
https://forums.phpfreaks.com/topic/136826-php-help/#findComment-716843
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.