
flattened
Members-
Posts
12 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
flattened's Achievements

Newbie (1/5)
0
Reputation
-
Previously Working Code Not Working in WordPress
flattened replied to flattened's topic in PHP Coding Help
Oh, I know want you mean. In the WordPress page, I did change it to <?PHP but it didn't change anything, it still didn't work. -
Previously Working Code Not Working in WordPress
flattened replied to flattened's topic in PHP Coding Help
I tried that on my code, but do you mean on the plugin file? -
I am in the process of integrating my current site into WordPress. Because I do a lot of hand coding I downloaded the Exec-PHP plugin. This is the current page I am moving : http://www.snookumz.com/you/graphics/swatches.php and here is the code: include("cookiecheck.php"); include("http://www.snookumz.com/top.php"); include($headervar.$skin.$extension); $sw= array(); require("swatch-list.php"); $count = count($sw); $per_page = 45; if (!isset($_GET['page']) || !is_numeric($_GET['page'])) { $page = 1; } $from = (($page * $per_page) - $per_page); $x=$from; $show = $from+$per_page; $total_results = $count; $total_pages = ceil($total_results / $per_page); echo "<div class='right'> Page "; for($x=1;$x<$page;$x++){ echo "<a href=\"?page=$x\">".$x."</a> "; } echo " <b>$page</b> "; for($x=($page+1);$x<=$total_pages;$x++){ echo "<a href=\"?page=$x\">".$x."</a> "; } echo "</div>"; echo "<div class='center'>"; while ($x<$show){ if($sw[$x])echo "$sw[$x] \n"; $x++; } echo "</div>"; echo "<div class='right'> Page "; for($x=1;$x<$page;$x++){ echo "<a href=\"?page=$x\">".$x."</a> "; } echo " <b>$page</b> "; for($x=($page+1);$x<=$total_pages;$x++){ echo "<a href=\"?page=$x\">".$x."</a> "; } echo "</div>"; include($footervar.$skin.$extension); The above code works perfectly. After stripping the header and footer tags, I have this left, and moved it to WordPress: $sw= array(); include("/URL/snookumz/you/graphics/swatch-list.php"); $count = count($sw); $per_page = 45; if (!isset($_GET['page']) || !is_numeric($_GET['page'])) { $page = 1; } $from = (($page * $per_page) - $per_page); $x=$from; $show = $from+$per_page; $total_results = $count; $total_pages = ceil($total_results / $per_page); echo "<div class='right'> Page "; for($x=1;$x<$page;$x++){ echo "<a href=\"&page=$x\">".$x."</a> "; } echo " <b>$page</b> "; for($x=($page+1);$x<=$total_pages;$x++){ echo "<a href=\"&page=$x\">".$x."</a> "; } echo "</div>"; echo "<div class='center'>"; while ($x<$show){ if($sw[$x])echo "$sw[$x] \n"; $x++; } echo "</div>"; echo "<div class='right'> Page "; for($x=1;$x<$page;$x++){ echo "<a href=\"&page=$x\">".$x."</a> "; } echo " <b>$page</b> "; for($x=($page+1);$x<=$total_pages;$x++){ echo "<a href=\"&page=$x\">".$x."</a> "; } echo "</div>"; But it returns the following error: I went to the plugin's site and read everything so I know it's my code, but I don't know where. I'd be less confused if it didn't work the first time, but it just doesn't work on the WordPress page. Any help is greatly appreciated. :-\ Thank you.
-
Oh, I'm sorry! The file is http://snookumz.com/tutorials.txt, that's the original file with all the records I entered the records on Access 2007 and used the export feature. http://snookumz.com/Tutorials.accdb if that matters any. The primary key is the first row with the 10 number (AccessKey). The fields are (in order): AccessKey, Title, ID, ProgramsUsed, Intro, Full_tuto, Keywords, and Preview Image When I run the query, I only get every other row except for the first (i.e. 1,2,4,6,8-96 in that manner [i deleted #97]) I haven't noticed any discrepancies in the records added and the ones not, other than the above mentioned. Just a thought, would this have anything to do with the id number? The only purpose of that is for the GET variable that will be used to call each tutorial, but it's not necessary elsewise. This is so frustrating because eveything else works, including the php aspect. Thank you very much for the responses
-
:'( I am having a hard time trying to understand why this is messing up. What is is supposed to do is: Create the table Populate it by the file Then show the titles of all the records (There are 97 records by the way) include 'config.php'; include 'opendb.php'; // Create a MySQL table in the selected database mysql_query("CREATE TABLE tutorials( accessKey INT(10) NOT NULL, PRIMARY KEY(AccessKey), title VARCHAR(100), id INT(5), previewImage VARCHAR(100), intro VARCHAR(500), full_Tutorial VARCHAR(52), keywords VARCHAR(100), programsUsed VARCHAR(50))") or die(mysql_error()); echo "Table Created!"; $sql="LOAD DATA LOCAL INFILE 'tutorials.txt' INTO TABLE tutorials FIELDS TERMINATED BY ';' ENCLOSED BY '\"' LINES TERMINATED BY '\n'"; $query = mysql_query($sql) or die(mysql_error()); echo "Data Added!"; $result = mysql_query("SELECT * FROM tutorials ORDER BY full_Tutorial ASC") or die(mysql_error()); echo "<ol>"; while($row = mysql_fetch_array( $result )) { echo "<li></li>"; } So, what happens is it does everything it's supposed to BUT it doesn't load all the records (loaded up to #46) I have tried reducing the # of records (tried adding just 8 ) but it still only showed 5. I don't know what to do. PS. Is it wrong for me to hope this is a real problem as opposed to just a missing character somewhere
-
Wow. I didn't even notice that. Been a long day. Thank you very much
-
Try this: -form content- <input type="submit" name="form" value="Submit Email!"> </form> <?php $posted=$_POST['form']; $name = $_POST['txtName']; $address = $_POST['txtAddress']; $city = $_POST['txtCity']; $email = $_POST['txtEmail']; $error = ""; if(isset($posted)){ if(empty($name) || empty($address) ||empty($city) || empty($email)){ echo "Could not complete submission: <br>"; if(empty($name)){ $error .="Missing Name!<br>"; } if(empty($address)){ $error .="Missing Address!<br>"; } if(empty($city)){ $error .="Missing City!"<br>; } if(empty($email)){ $error .="Missing Email!"; } echo $error; } else{ $body = "A user has submitted a form with the following:\n\n"; $body .= "Name: $name\n"; $body .= "Address: $address\n"; $body .= "City: $city\n"; $body .= "Email: $email\n"; mail( "myemail@test.com", "My nice little subject", $body, "From: $email"); echo "Thank you for submitting your request..."; } } ?>
-
Include external domain content in site
flattened replied to ultrasound0000's topic in PHP Coding Help
Have you tried just using frames and getting rid of the borders? -
It would be easier to implement a $count variable $path = "bilder/"; $dir_handle = @opendir($path) ; $count = 1; while ($file = readdir($dir_handle)) { if($file!="." && $file!=".."){ echo "<a href='?pic_id=".$count."'><img src='".$path."/".$count.".jpg' border='0' width='40' height='40'/></a> "; $count++; } } closedir($dir_handle);
-
imagecreatefrompng breaks if theres a space in the url
flattened replied to patawic's topic in PHP Coding Help
Hey! I had a simlar problem: users would input text, and it would be on a generated image, but it never output more than one word (lest I want an error) Now, I don't know how you have your's set up, but hopefully how I did mine can help you in some sort of way On the page to output the new url: $text = $_POST['text']; //Inputted text $text = str_replace(" ", "+",$text); //text in the url in the url now it's: url.com/image.php?t=file+name then on the page to create the image: $string = $_GET['t']; //gets what ever is set to "t" $string = str_replace("+", " ",$string); // replaces "+" with " " (a space) on the image and use $string for the text variable. hope that can help -
I'm trying to make a plugboard (success) that allows the input of common button sizes (88x31, 100x35, 468x60 [success]) and displays them based on the get variable (FAIL). But my problem is, it's not following the GET, it just prints everything: $myFile is the file (that part works fine) if($_GET[ads]="small"){ $file_handle = fopen($myFile, "rb"); while (!feof($file_handle) ) { $line_of_text = fgets($file_handle); $parts = explode('|', $line_of_text); if($parts[4] == "0" && $parts[0]== 31){ $alt= $parts[2]; if($parts[2]==""){$alt=$parts[3];} echo " <a href=\"".$parts[3]."\"><img src=\"".$parts[1]."\" alt=\"".$alt."\" target=\"_blank\"></a>"; } } } if($_GET[ads]="medium"){ $file_handle = fopen($myFile, "rb"); while (!feof($file_handle) ) { $line_of_text = fgets($file_handle); $parts = explode('|', $line_of_text); if($parts[4] == "0" && $parts[0]== 35){ $alt= $parts[2]; if($parts[2]==""){$alt=$parts[3];} echo "<a href=\"".$parts[3]."\"><img src=\"".$parts[1]."\" alt=\"".$alt."\" target=\"_blank\"></a>"; } } } if($_GET[ads]="large"){ $file_handle = fopen($myFile, "rb"); while (!feof($file_handle) ) { $line_of_text = fgets($file_handle); $parts = explode('|', $line_of_text); if($parts[4] == "0" && $parts[0]== 35){ $alt= $parts[2]; if($parts[2]==""){$alt=$parts[3];} echo "<a href=\"".$parts[3]."\"><img src=\"".$parts[1]."\" alt=\"".$alt."\" target=\"_blank\"></a>"; } } } Does anyone see why this would not work? Any help would be greatly appreciated.