Jump to content

jonw118

Members
  • Posts

    77
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jonw118's Achievements

Member

Member (2/5)

0

Reputation

  1. Hello. I'd greatly appreciate any help!!! Basically I have a form on my page. When this form is field out it posts the results to the iContact (subscribes to a list). iContact requires that form field for email be called "fields_email". Ok. Now, I have a redirect URL we have to use which needs the email in the URL string. For example, the form field "fields_email" has a value of test@test.com. For that redirect link I need it to be: http://www.test.com/email=test@test.com. See below: <form method=post action="https://app.icontact.com/icp/signup.php" name="icpsignup" id="XXXX" accept-charset="UTF-8";" > <input type=hidden name=redirect value="http://XXXXX.com/?email="FIELDS_EMAIL" /> <label>Primary Email</label> <input type="text" name="fields_email" id="fields_email"> How can I replace the "FIELDS_EMAIL" in the redirect URL with the value entered by the user? I hope this makes sense. Thanks again for any help!
  2. I am using the following php script to display all the files that are uploaded in a directory on a page. There are two files in the folder I do not want displayed: .htaccess & index.php. Can someone help me out and provide a little guidance about what I need to do to print all the file names EXCEPT for those two. I imagine some sort of if statement. CODE: Top of page: <?php $dirname = "."; $dir = opendir($dirname); ?> Body: <?php while(false != ($file = readdir($dir))) { if(($file != ".") and ($file != "..")) { echo("<a href='$dirname$file'>$file</a> <br />"); } } ?> Thanks so much!
  3. Hi all - I'd greatly appreciate any help. I am using phpMyAdmin and trying to export a table to a CSV. Many rows within the CSV do not have any values in any of the columns. When I go to export to CSV it "skips" these rows and doesn't export them. Does anyone know if it's possible to export the rows to CSV even if there are null values in a rows columns? Thanks!
  4. Awesome!!! Thanks so much for the help. Now, here is a little tricky question since I can now get them all in a table. In the function it calls to order them by ID. Is there anyway it could order them all alpha versus the "ORDER BY 'id'" or is that not possible because of this statement in the function (which is needed for the category specific pages): $sql = "SELECT * FROM `".TBL_PORTFOLIO."` WHERE id IN (SELECT `portfolio_id` FROM `".TBL_PORTFOLIO_INDUSTRY."` WHERE `industry` = '$industry') ORDER BY `id`"; $data=SelectMultiRecords($sql); return $data; }
  5. Hi there, I have a site that has several different pages which display products from each category on the designated page. What I am looking to do is create one page that also lists ALL the products. Right now, in the category specific page it has this is in the code: $data = get_portfolio_industry('Building Products'); $offset = $_GET['offset']; if($offset == ''){ $offset = 0; } function get_industries($rec_id){ $sql = "SELECT * FROM `".TBL_PORTFOLIO_INDUSTRY."` WHERE `portfolio_id` = '$rec_id'"; $data = SelectMultiRecords($sql); return $data; } And this is the from the functions file: function get_portfolio_industry($industry){ $sql = "SELECT * FROM `".TBL_PORTFOLIO."` WHERE id IN (SELECT `portfolio_id` FROM `".TBL_PORTFOLIO_INDUSTRY."` WHERE `industry` = '$industry') ORDER BY `id`"; $data=SelectMultiRecords($sql); return $data; } My hope was I would simple combine the products like this: $data = get_portfolio_industry('Building Products,Building Services,General Products'); ...but unfortunately it doesn't combine them. Any thoughts? Any help would be much appreciated.
  6. Hi there - can anyone lend me a little advise as to what I'm doing wrong here. I have this line: $query=mysql_query("SELECT * FROM gallery a JOIN gallery_image b ON a.id = b.gallery_id where gallery_id=$gallery_id"); I am trying to add an order by statement: order by gallery_image.priority So I created: $query=mysql_query("SELECT * FROM gallery a JOIN gallery_image b ON a.id = b.gallery_id where gallery_id=$gallery_id order by gallery_image.priority"); But, I receive the error (even though there is table called "Gallery Image" and a column called "Priority": Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/***/public_html/***/gallery.php on line 5 select: Unknown column 'gallery_image.priority' in 'order clause'
  7. Hello... I'm not sure how to (if it can be done) restrict an image height ONLY if it is over a certain amount of pixels. Specifically, right now the script resizes images by width only. But sometimes, if an image that is long vertically is uploaded it throws the format off, so in that case, I do want it resize by width AND height, but only in that case. I hope that makes sense. Basically if right now an image is inserted that is 1500px x 1500px I only want it to scale the image width (ie, scaled to 150px wide), keeping the height in proporotion automatically (150px height for this example). But if an image is 1500 x 4000, for example, I'd like it to scale to something like (150px X 150px)... and yes I know it will distort the image, but it will be better than how it breaks the format currently. Is this possible? The specific code I am working with is: <img style='float: center; margin-right: 5px;' width='150px' src='$img' /> Thanks for any suggestions!!!
  8. Hello... I have a website that has worked with no problem. I login using .../admin and enter credentials. I've moved it to a new server and frontend works fine. When I trying logging in the backend, it I enter the wrong user/pass it tells me wrong user/pass. But when I enter in the correct credentials it simply reloads the login page versus the index page with no message. Since I get the message when it's incorrect I know it's connecting to the DB. The php versions are the same. I have php error logging and it's not giving an error. Can anyone give me tips or advice as to what I should be looking for? Thanks!
  9. I have program that pulls in a lot of different modules and centralizes them to one menu. One of the modules lists all the individual CMS pages. I need these pages to display by the "priority" column. Unfortunately I've tried alot of different things to sort the CMS module pages by priority, but to no success. I hope I am providing all that is needed from the code here - and if anyone could lend any advise as to where I add the ORDER BY priority ASC I'd appreciate. From the index page, here is the code that loads the modules... this is where I've been trying to dissect where modules join and how to create a sort order for bullet point CMS pages: <?php foreach($sorted_modules as $module_name=>$seq) { if(count($menus[$module_name])==0 ) continue;?> <tr valign=top align=left> <td width=139 class="TextObject" style='padding-left:10px'> <?php if(strlen($menu_text[$module_name])>0) {?> <p><b><span style="font-family: Arial, Helvetica, Geneva, Sans-serif; font-size: 11pt;"> <?php echo ucwords($menu_text[$module_name]);?>- </span></b></p> <?php } foreach($menus[$module_name] as $name=>$action) echo "<li><span style='font-family: Arial,Helvetica,Geneva,Sans-serif; font-size: 10pt; color: rgb(39,90,121);'><a href='index.php?module=$module_name&action=$action'/>$name</a></span></li>";?> </td> </tr> <?php }?> Thanks - hope this makes sense what I'm trying to do!
  10. Yeah I guess I'll post over in the PHP Forum... my intent with posting on the MySQL forum was hoping there a solution from this angle, which there's not. But thanks much for answering my question, albeit not the answer I wanted, haha.
  11. "Databases do not store data in any particular order, it is up to you to write your select statements in such a way the the data is retrieved in the order you want." Yeah I know it's not written/stored in a particular order, and understand it's not flat, but once the data is in there the row location doesn't change. So that's all I'm trying to do is change the order it's stored (or shown in phpMyAdmin)... because the order it is stored is the order it displays on the frontend. But as I feared and as you confirmed there's nothing I can do about that I guess. "I fail to see why. Can you tell us why you can't?" It is pulling many different modules menus loading into a centralized menu, the modules are then joined with one another and the module in question displays several different levels of navigation (which needs to be sorted). But the other modules do not need to be sorted. And it is the same statement joining all of these together. I know that sounds confusing, just the way it was written, which I've struggled to dissect and implement an effective order by.
  12. I have a unique situation where I have a php script that is very complex and I cannot do a simple order by priority. Instead it displays the data on the frontend in the exact order it is stored in the MySQL database. Is there any way (I've looked high and low!) to change the order that rows appear in the MySQL database. Ideally I'd like for the table to display the table rows in asc order by the column "page_name". Not sure this is possible to alter the table to achieve this. Does anyone know? Thanks much for any help!
  13. Keith- soooo sorry - hope you don't mind me asking you one more thing. On one of the gallery pages I have 3 photos displayed - and the gallery_name (which we were working on adding) at the top of the page is showing 3 different times. I'm using <?php echo $res['gallery_name']; ?> to show the name. Again, thank you so much for your help. Hope this is something simple I'm missing. I've been pulling the hair trying different things.
  14. Thanks so much for your help Keith - I really, really appreciate it!
  15. I think I see what the problem is here - not sure how I got that empty error - can't duplicate it. But I just the mysql_error - and got the result: "Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/***/main/gallery.php on line 5 select: Column 'priority' in order clause is ambiguous" I think this is because both gallery has a priority and gallery_image has a priority. For the gallery priority, it is irrelevant on this page (as it set priority for the gallery options page). But it does need the priority for the gallery_image as it sets the sort order for the pictures.
×
×
  • 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.